3 # This is a startup/shutdown script for Index Data's Zebra server,
4 # suitable for use in a SysV-style init directory such as /etc/init.d
5 # (on Debian systems) and /etc/rc.d/init.d (on Red Hat systems), like
8 # sudo cp idzebra-init-script /etc/init.d/idzebra
9 # sudo /etc/init.d/idzebra start
11 # You may need to tweak it to suit your system's paths.
13 # zebrasrv-2.0 may be in /usr/local/bin, hence this slight security hole
14 PATH=/bin:/usr/bin:/usr/local/bin/
15 catfile=/usr/local/src/cvs/zebra/etc/init.d/catalogue
20 line=`echo "$line" | sed 's/#.*//'`
21 line=`echo "$line" | sed 's/[ \t]*$//'`
22 if [ "x$line" != x ]; then
23 set $line; tag=$1; dir=$2; file=$3
24 #echo "tag='$tag', dir='$dir', file='$file'"
26 logfile=/var/log/zebra-$tag
27 pidfile=/var/run/zebra-$tag.pid
28 if [ -f $pidfile ]; then
29 echo "Zebra service '$tag' seems to be already running"
32 echo "Starting Zebra service '$tag'"
33 test -f $logfile && mv $logfile $logfile.old
37 *) echo "Unrecognised Zebra config-file type: '$file'";;
42 echo === $dir zebrasrv-2.0 $opt $file === < /dev/null > $logfile 2>&1
43 ( zebrasrv-2.0 $opt $file < /dev/null >> $logfile 2>&1 & )
51 # Unfortunate partial duplication of parsing code here
53 line=`echo "$line" | sed 's/#.*//'`
54 line=`echo "$line" | sed 's/[ \t]*$//'`
55 if [ "x$line" != x ]; then
58 pidfile=/var/run/zebra-$tag.pid
59 if [ ! -f $pidfile ]; then
60 echo "Zebra service '$tag' does not seem to be running"
64 echo "Stopping Zebra service '$tag'"
75 echo "Usage: $0 start|stop|restart" >&2