From 382ea2685628fcfb8f7c5cc4db35d9f9f505ed4a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 19 May 2003 21:35:02 +0000 Subject: [PATCH] Debian zebrasrv start/stop --- util/zebrasrv | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 util/zebrasrv diff --git a/util/zebrasrv b/util/zebrasrv new file mode 100755 index 0000000..d99bef5 --- /dev/null +++ b/util/zebrasrv @@ -0,0 +1,50 @@ +#! /bin/sh +# $Id: zebrasrv,v 1.1 2003-05-19 21:35:02 adam Exp $ +# Start and stop idzebra script for Debian. + +test -x /usr/bin/zebrasrv || exit 0 + +dirs="/var/lib/idzebra" +uid=nobody + +case "$1" in + start) + for d in $dirs; do + if [ ! -d $d ]; then + mkdir $d + fi + done + echo -n "Starting IDZebra server: zebrasrv" + for d in $dirs; do + start-stop-daemon --start --quiet --background --pidfile $d/zebrasrv.pid --exec /usr/bin/zebrasrv -- -w $d -u $uid -l log tcp:@:210 + done + echo "." + ;; + stop) + echo -n "Stopping IDZebra server: zebrasrv" + for d in $dirs; do + start-stop-daemon --stop --quiet --oknodo --pidfile $d/zebrasrv.pid + done + echo "." + ;; + + reload|force-reload) + echo -n "Reloading IDZebra server's configuration" + for d in $dirs; do + start-stop-daemon --stop --signal 1 --quiet --background --oknodo --pidfile $d/zebrasrv.pid --exec /usr/bin/zebrasrv -- -w $d -u $uid -l log tcp:@:210 + done + echo "." + ;; + + restart) + $0 stop + sleep 2 + $0 start + ;; + + *) + echo "Usage: /etc/init.d/zebrasrv {start|stop|reload|force-reload|restart}" + exit 1 +esac + +exit 0 -- 1.7.10.4