[Koha] Contents of koha-zebra-daemon in /etc/init.d (Debian)

Abhishek Amberkar [अभिषेक] abhishek.amberkar at gmail.com
Fri Nov 27 17:59:13 NZDT 2009


2009/11/27 Marty <ontariowolf64 at yahoo.com>

> Can somebody please send me contents of koha-zebra-daemon in /etc/init.d
> I have a standard koha installation, on Debian, with koha-zebra-ctl.sh in
> /usr/share/koha/bin
> For some reason I still have not been able to start the zebra server except
> manually and that just won't do. I have followed all the instructions, but I
> think something is wrong with the koha-zebra-daemon file. I cannot start the
> zebra server by doing /etc/init.d/koha-zebra-daemon start. Please?
> Thanks,
> Marty
>
> ------------------------------
> Make your browsing faster, safer, and easier with the new Internet
> Explorer® 8. Optimized for Yahoo! *Get it Now for Free! *<http://downloads.yahoo.com/ca/internetexplorer/>
>
> _______________________________________________
> Koha mailing list
> Koha at lists.katipo.co.nz
> http://lists.katipo.co.nz/mailman/listinfo/koha
>
>
Are you sure it is "/etc/init.d/koha-zebra-daemon start" ?

Following are the steps according to manual, please check them...



Configuration of Zebra Server

Make zebra server to start at system startup

$ sudo ln -sv /usr/share/koha/bin/koha-zebra-ctl.sh /etc/init.d/zebra-server

$ sudo update-rc.d zebra-server defaults

$ sudo /etc/init.d/zebra-server start

Make zebraqueue daemon to start at system startup

$ sudo ln -sv /usr/share/koha/bin/koha-zebraqueue-ctl.sh
/etc/init.d/zebraqueue-daemon

$ sudo update-rc.d zebraqueue-daemon defaults

$ sudo /etc/init.d/zebraqueue-daemon start

Following are the scripts on MY SYSTEM.


abhishek at europa:~$ cat /etc/init.d/zebraqueue-daemon
#!/bin/bash
USER=koha
GROUP=koha
DBNAME=koha
NAME=koha-zebraqueue-ctl-$DBNAME
LOGDIR=/var/log/koha
PERL5LIB=/usr/share/koha/lib
KOHA_CONF=/etc/koha/koha-conf.xml
ERRLOG=$LOGDIR/koha-zebraqueue.err
STDOUT=$LOGDIR/koha-zebraqueue.log
OUTPUT=$LOGDIR/koha-zebraqueue-output.log
export KOHA_CONF
export PERL5LIB
ZEBRAQUEUE=/usr/share/koha/bin/zebraqueue_daemon.pl

test -f $ZEBRAQUEUE || exit 0

OTHERUSER=''
if [[ $EUID -eq 0 ]]; then
    OTHERUSER="--user=$USER.$GROUP"
fi

case "$1" in
    start)
      echo "Starting Zebraqueue Daemon"
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER -- perl -I $PERL5LIB $ZEBRAQUEUE
-f $KOHA_CONF
      ;;
    stop)
      echo "Stopping Zebraqueue Daemon"
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER --stop -- perl -I $PERL5LIB
$ZEBRAQUEUE -f $KOHA_CONF
      ;;
    restart)
      echo "Restarting the Zebraqueue Daemon"
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER --restart -- perl -I $PERL5LIB
$ZEBRAQUEUE -f $KOHA_CONF
      ;;
    *)
      echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
      exit 1
      ;;
esac
--------------------------------------

abhishek at europa:~$ cat /etc/init.d/zebra-server
#!/bin/bash
USER=koha
GROUP=koha
DBNAME=koha
NAME=koha-zebra-ctl.$DBNAME
LOGDIR=/var/log/koha
ERRLOG=$LOGDIR/koha-zebradaemon.err
STDOUT=$LOGDIR/koha-zebradaemon.log
OUTPUT=$LOGDIR/koha-zebradaemon-output.log
KOHA_CONF=/etc/koha/koha-conf.xml
RUNDIR=/var/run/koha/zebradb
LOCKDIR=/var/lock/koha/zebradb
# you may need to change this depending on where zebrasrv is installed
ZEBRASRV=/usr/bin/zebrasrv
ZEBRAOPTIONS="-v none,fatal,warn"

test -f $ZEBRASRV || exit 0

OTHERUSER=''
if [[ $EUID -eq 0 ]]; then
    OTHERUSER="--user=$USER.$GROUP"
fi

case "$1" in
    start)
      echo "Starting Zebra Server"

      # create run and lock directories if needed;
      # /var/run and /var/lock are completely cleared at boot
      # on some platforms
      if [[ ! -d $RUNDIR ]]; then
        umask 022
        mkdir -p $RUNDIR
        if [[ $EUID -eq 0 ]]; then
            chown $USER:$GROUP $RUNDIR
        fi
      fi
      if [[ ! -d $LOCKDIR ]]; then
        umask 022
        mkdir -p $LOCKDIR
        mkdir -p $LOCKDIR/biblios
        mkdir -p $LOCKDIR/authorities
        if [[ $EUID -eq 0 ]]; then
            chown -R $USER:$GROUP $LOCKDIR
        fi
      fi

      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER -- $ZEBRASRV $ZEBRAOPTIONS -f
$KOHA_CONF
      ;;
    stop)
      echo "Stopping Zebra Server"
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER --stop -- $ZEBRASRV -f
$KOHA_CONF
      ;;
    restart)
      echo "Restarting the Zebra Server"
      daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT
--verbose=1 --respawn --delay=30 $OTHERUSER --restart -- $ZEBRASRV -f
$KOHA_CONF
      ;;
    *)
      echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
      exit 1
      ;;
esac

-- 
With Regards
Abhishek Amberkar
http://www.kohaindia.org/
RDG Microelectronics Pvt. Ltd.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.katipo.co.nz/pipermail/koha/attachments/20091127/de351cf7/attachment.htm 


More information about the Koha mailing list