uknet80
asked on
can i use this script without having daemon service
I have this script below, i don't have daemon service on my system and can't find any for it.
is it posible to run this script without having daemon command
#!/bin/bash
USER=koha
GROUP=koha
DBNAME=koha
NAME=koha-zebra-ctl.$DBNAM E
LOGDIR=/var/log/koha
ERRLOG=$LOGDIR/koha-zebrad aemon.err
STDOUT=$LOGDIR/koha-zebrad aemon.log
OUTPUT=$LOGDIR/koha-zebrad aemon-outp ut.log
KOHA_CONF=/etc/koha/koha-c onf.xml
RUNDIR=/var/run/koha/zebra db
LOCKDIR=/var/lock/koha/zeb radb
# 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.$G ROUP"
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
;;
is it posible to run this script without having daemon command
#!/bin/bash
USER=koha
GROUP=koha
DBNAME=koha
NAME=koha-zebra-ctl.$DBNAM
LOGDIR=/var/log/koha
ERRLOG=$LOGDIR/koha-zebrad
STDOUT=$LOGDIR/koha-zebrad
OUTPUT=$LOGDIR/koha-zebrad
KOHA_CONF=/etc/koha/koha-c
RUNDIR=/var/run/koha/zebra
LOCKDIR=/var/lock/koha/zeb
# 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.$G
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
;;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER