Enable any element set and grs-1 in sample
[yaz-moved-to-github.git] / etc / debian.init.d
1 #! /bin/sh
2 # $Id: debian.init.d,v 1.1 2004-01-18 21:11:11 adam Exp $
3 # Debian sample start/stop script for YAZ Generic Frontend Server
4 #
5 set -e
6
7 DAEMON=/usr/local/bin/yaz-ztest
8 NAME=yaz-ztest
9 PIDFILE=/var/run/yaz-ztest.pid
10 LOGFILE=/var/log/yaz-ztest.log
11 RUNAS=nobody
12
13 test -x $DAEMON || exit 0
14
15 case "$1" in
16   start)
17     echo -n "Starting YAZ server: "
18     start-stop-daemon --start --pidfile $PIDFILE \
19                             --exec $DAEMON -- \
20                             -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210
21                           
22     echo "$NAME."
23     ;;
24   stop)
25     echo -n "Stopping YAZ server: "
26     start-stop-daemon --stop --pidfile $PIDFILE \
27                             --oknodo --retry 30 --exec $DAEMON
28     echo "$NAME."
29       ;;
30   restart)
31     echo -n "Restarting YAZ server: "
32     start-stop-daemon --stop --pidfile $PIDFILE  \
33                             --oknodo --retry 30 --exec $DAEMON
34     start-stop-daemon --start --pidfile $PIDFILE d \
35                             --exec $DAEMON -- \
36                             -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210
37     echo "$NAME."
38     ;;
39   reload|force-reload)
40     echo "Reloading $NAME configuration files"
41     start-stop-daemon --stop --pidfile $PIDFILE \
42                             --signal 1 --exec $DAEMON
43     ;;
44   *)
45     echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
46     exit 1
47     ;;
48 esac
49
50 exit 0