[Koha] koha-index-daemon

sunil sharma koha.sunil007 at gmail.com
Fri Sep 21 21:12:56 NZST 2012


Dear All,

I am facing an error while executing my koha-index-daemon file using *
"koha-index-daemon-ctl.sh"*.

My koha-index-daemon-ctl.sh file is as:

#!/bin/sh

# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR
# A PARTICULAR PURPOSE.  See the GNU General Public License for more
details.
#
# You should have received a copy of the GNU General Public License along
with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple
Place,
# Suite 330, Boston, MA  02111-1307 USA

### BEGIN INIT INFO
# Provides:          koha-index-daemon-$DBNAME
# Required-Start:    $local_fs $syslog
# Required-Stop:     $local_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     false
# Short-Description: Start/stop koha-index-daemon for $DBNAME
### END INIT INFO

. /lib/lsb/init-functions

USER=koha
GROUP=koha
DBNAME=koha
NAME=koha-index-daemon-$DBNAME
LOGDIR=/var/log/koha
PERL5LIB=/usr/share/koha/lib
KOHA_CONF=/etc/koha/koha-conf.xml
ERRLOG=$LOGDIR/koha-index-daemon.err
STDOUT=$LOGDIR/koha-index-daemon.log
OUTPUT=$LOGDIR/koha-index-daemon-output.log

export KOHA_CONF
export PERL5LIB

INDEXDAEMON="koha-index-daemon"
INDEXDAEMON_OPTS="--timeout 30 --conf $KOHA_CONF \
                  --directory /var/tmp/koha-index-daemon-$DBNAME"

DAEMONOPTS="--name=$NAME \
            --errlog=$ERRLOG \
            --stdout=$STDOUT \
            --output=$OUTPUT \
            --verbose=1 --respawn --delay=30"

USER="--user=$USER.$GROUP"


case "$1" in
    start)
      log_daemon_msg "Starting Koha indexing daemon ($DBNAME)"
      if daemon $DAEMONOPTS $USER -- $INDEXDAEMON $INDEXDAEMON_OPTS; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
      ;;
    stop)
      log_daemon_msg "Stopping Koha indexing daemon ($DBNAME)"
      if daemon $DAEMONOPTS $USER --stop -- $INDEXDAEMON $INDEXDAEMON_OPTS;
then
        log_end_msg 0
      else
        log_end_msg 1
      fi
      ;;
    restart)
      log_daemon_msg "Restarting the Koha indexing daemon ($DBNAME)"
      if daemon $DAEMONOPTS $USER --restart -- $INDEXDAEMON
$INDEXDAEMON_OPTS; then
        log_end_msg 0
      else
        log_end_msg 1
      fi
      ;;
    *)
      log_success_msg "Usage: /etc/init.d/$NAME {start|stop|restart}"
      exit 1
      ;;
esac

Then I create a symlink for this script as:-

$ ln -s /usr/share/koha/bin/koha-zebra-indexdaemon-ctl.sh
/etc/init.d/koha-zebra-indexdaemon


While I am running this file giving any option start|stop|restart it
displays error, like as below:

$ /etc/init.d/koha-index-daemon start

shows error:-

/etc/init.d/koha-index-daemon: line 59: log_daemon_msg: command not found
/etc/init.d/koha-index-daemon: line 60: daemon: command not found
/etc/init.d/koha-index-daemon: line 63: log_end_msg: command not found

And such as,

/etc/init.d/koha-index-daemon stop

shows error:-

/etc/init.d/koha-index-daemon: line 67: log_daemon_msg: command not found
/etc/init.d/koha-index-daemon: line 68: daemon: command not found
/etc/init.d/koha-index-daemon: line 71: log_end_msg: command not found

Any body can help me in this regard is very useful to me. I am using *koha
3.08* on *centos 6.2*. My zebra index version is
*Zebra<http://www.indexdata.com/zebra>2.0.52.


Thanx in Advance,

Sunil   *


More information about the Koha mailing list