3
# skeleton example file to build /etc/init.d/ scripts.
4
# This file should be used to construct scripts for /etc/init.d.
6
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
7
# Modified for Debian GNU/Linux
8
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
10
# Version: @(#)skeleton 1.8 03-Mar-1998 miquels@cistron.nl
12
# This file was automatically customized by dh-make on Tue, 24 Apr 2001 23:09:17 +0300
14
PATH=/sbin:/bin:/usr/sbin:/usr/bin
15
DAEMON=/usr/sbin/zoneserver
16
DEFAULT=/etc/default/maradns
21
test -f $DAEMON || exit 0
22
test -f $DEFAULT && . $DEFAULT
24
if ! [ "$SERVERS" ] ; then
25
echo "No servers configured"
34
echo -n "Starting $DESC: "
35
for rcfile in $SERVERS ; do
36
if grep -q -i "^zone_transfer_acl" $rcfile; then
37
SERVERNAME=`echo $rcfile | sed 's/\//_/g;s/^_*//;' | awk -F. '{print $NF}'`
38
SERVERNAME=zoneserver.$SERVERNAME
39
start-stop-daemon --start -m --pidfile /var/run/$SERVERNAME.pid \
40
--exec $DAEMON -- -f $SERVERS </dev/null 2>&1 | logger -p daemon.notice -t $SERVERNAME 2>/dev/null &
42
echo "No zone ACL's configured for $rcfile -- not starting zoneserver for it."
48
echo -n "Stopping $DESC: "
49
for rcfile in $SERVERS ; do
50
if grep -q -i "^zone_transfer_acl" $rcfile; then
51
SERVERNAME=`echo $rcfile | sed 's/\//_/g;s/^_*//;' | awk -F. '{print $NF}'`
52
SERVERNAME=zoneserver.$SERVERNAME
53
start-stop-daemon --stop -m --quiet --pidfile /var/run/$SERVERNAME.pid \
61
# If the daemon can reload its config files on the fly
62
# for example by sending it SIGHUP, do it here.
64
# If the daemon responds to changes in its config file
65
# directly anyway, make this a do-nothing entry.
67
# echo "Reloading $DESC configuration files."
68
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
69
# /var/run/$NAME.pid --exec $DAEMON
73
# If the "reload" option is implemented, move the "force-reload"
74
# option to the "reload" entry above. If not, "force-reload" is
75
# just the same as "restart".
77
echo -n "Restarting $DESC: "
78
#start-stop-daemon --stop --quiet --pidfile \
79
# /var/run/$NAME.pid --exec $DAEMON
81
#start-stop-daemon --start --quiet --pidfile \
82
# /var/run/$NAME.pid --exec $DAEMON
90
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
91
echo "Usage: $N {start|stop|restart|force-reload}" >&2