Zebra startup: create /var/run and /var/lock subdirs if needed
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
71dd69d5ac
commit
27031a13fe
1 changed files with 19 additions and 0 deletions
|
@ -7,6 +7,8 @@ ERRLOG=$LOGDIR/koha-zebradaemon.err
|
||||||
STDOUT=$LOGDIR/koha-zebradaemon.log
|
STDOUT=$LOGDIR/koha-zebradaemon.log
|
||||||
OUTPUT=$LOGDIR/koha-zebradaemon-output.log
|
OUTPUT=$LOGDIR/koha-zebradaemon-output.log
|
||||||
KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
|
KOHA_CONF=__KOHA_CONF_DIR__/koha-conf.xml
|
||||||
|
RUNDIR=__ZEBRA_RUN_DIR__
|
||||||
|
LOCKDIR=__ZEBRA_LOCK_DIR__
|
||||||
# you may need to change this depending on where zebrasrv is installed
|
# you may need to change this depending on where zebrasrv is installed
|
||||||
ZEBRASRV=/usr/bin/zebrasrv
|
ZEBRASRV=/usr/bin/zebrasrv
|
||||||
|
|
||||||
|
@ -15,6 +17,23 @@ test -f $ZEBRASRV || exit 0
|
||||||
case "$1" in
|
case "$1" in
|
||||||
start)
|
start)
|
||||||
echo "Starting Zebra Server"
|
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
|
||||||
|
chown $USER:$GROUP $RUNDIR
|
||||||
|
fi
|
||||||
|
if [[ ! -d $LOCKDIR ]]; then
|
||||||
|
umask 022
|
||||||
|
mkdir -p $LOCKDIR
|
||||||
|
mkdir -p $LOCKDIR/biblios
|
||||||
|
mkdir -p $LOCKDIR/authorities
|
||||||
|
chown -R $USER:$GROUP $LOCKDIR
|
||||||
|
fi
|
||||||
|
|
||||||
daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --user=$USER.$GROUP -- $ZEBRASRV -f $KOHA_CONF
|
daemon --name=$NAME --errlog=$ERRLOG --stdout=$STDOUT --output=$OUTPUT --verbose=1 --respawn --delay=30 --user=$USER.$GROUP -- $ZEBRASRV -f $KOHA_CONF
|
||||||
;;
|
;;
|
||||||
stop)
|
stop)
|
||||||
|
|
Loading…
Reference in a new issue