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
19
# If you want to start more than one server (binding to different IPs), you
20
# may write different configuration files and list them here, separated by
21
# spaces. This script will start one server for each one of them.
23
SERVERS="/etc/maradns/mararc"
25
test -f $DAEMON || exit 0
31
echo -n "Starting $DESC: "
32
for rcfile in $SERVERS ; do
33
if grep -q -i "^zone_transfer_acl" $rcfile; then
34
SERVERNAME=`echo $rcfile | sed 's/\//_/g;s/^_*//;' | awk -F. '{print $NF}'`
35
SERVERNAME=zoneserver.$SERVERNAME
36
start-stop-daemon --start -m --pidfile /var/run/$SERVERNAME.pid \
37
--exec $DAEMON -- -f $SERVERS 2>&1 | logger -p daemon.notice -t $SERVERNAME &
39
echo "No zone ACL's configured for $rcfile -- not starting zoneserver for it."
45
echo -n "Stopping $DESC: "
46
for rcfile in $SERVERS ; do
47
if grep -q -i "^zone_transfer_acl" $rcfile; then
48
SERVERNAME=`echo $rcfile | sed 's/\//_/g;s/^_*//;' | awk -F. '{print $NF}'`
49
SERVERNAME=zoneserver.$SERVERNAME
50
start-stop-daemon --stop -m --quiet --pidfile /var/run/$SERVERNAME.pid \
58
# If the daemon can reload its config files on the fly
59
# for example by sending it SIGHUP, do it here.
61
# If the daemon responds to changes in its config file
62
# directly anyway, make this a do-nothing entry.
64
# echo "Reloading $DESC configuration files."
65
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
66
# /var/run/$NAME.pid --exec $DAEMON
70
# If the "reload" option is implemented, move the "force-reload"
71
# option to the "reload" entry above. If not, "force-reload" is
72
# just the same as "restart".
74
echo -n "Restarting $DESC: "
75
#start-stop-daemon --stop --quiet --pidfile \
76
# /var/run/$NAME.pid --exec $DAEMON
78
#start-stop-daemon --start --quiet --pidfile \
79
# /var/run/$NAME.pid --exec $DAEMON
87
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
88
echo "Usage: $N {start|stop|restart|force-reload}" >&2