Debian zebrasrv start/stop
authorAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 May 2003 21:35:02 +0000 (21:35 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Mon, 19 May 2003 21:35:02 +0000 (21:35 +0000)
util/zebrasrv [new file with mode: 0755]

diff --git a/util/zebrasrv b/util/zebrasrv
new file mode 100755 (executable)
index 0000000..d99bef5
--- /dev/null
@@ -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