~ubuntu-branches/ubuntu/saucy/maradns/saucy

« back to all changes in this revision

Viewing changes to debian/maradns.zoneserver.init

  • Committer: Bazaar Package Importer
  • Author(s): Jaakko Niemi
  • Date: 2004-09-26 16:47:16 UTC
  • Revision ID: james.westby@ubuntu.com-20040926164716-nhfz4nb4bu891eqi
Tags: 1.0.23-4
* Sponsored upload
* Closes: #269839: maradns: multiple server configuration broken
* Added tutorial in README.Debian to set up a "wildcard" authoritative 
  server
* Added wildcard example

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# skeleton      example file to build /etc/init.d/ scripts.
 
4
#               This file should be used to construct scripts for /etc/init.d.
 
5
#
 
6
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
 
7
#               Modified for Debian GNU/Linux
 
8
#               by Ian Murdock <imurdock@gnu.ai.mit.edu>.
 
9
#
 
10
# Version:      @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
 
11
#
 
12
# This file was automatically customized by dh-make on Tue, 24 Apr 2001 23:09:17 +0300
 
13
 
 
14
PATH=/sbin:/bin:/usr/sbin:/usr/bin
 
15
DAEMON=/usr/sbin/zoneserver
 
16
DEFAULT=/etc/default/maradns
 
17
 
 
18
NAME="zoneserver"
 
19
DESC="zoneserver"
 
20
 
 
21
test -f $DAEMON || exit 0
 
22
test -f $DEFAULT && . $DEFAULT
 
23
 
 
24
if ! [ "$SERVERS" ] ; then
 
25
echo "No servers configured"
 
26
exit 0
 
27
fi
 
28
 
 
29
 
 
30
set -e
 
31
 
 
32
case "$1" in
 
33
  start)
 
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 &
 
41
            else
 
42
                echo "No zone ACL's configured for $rcfile -- not starting zoneserver for it."
 
43
            fi
 
44
        done
 
45
        echo "$NAME."
 
46
        ;;
 
47
  stop)
 
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 \
 
54
                    $DAEMON
 
55
            fi
 
56
        done
 
57
        echo "$NAME."
 
58
        ;;
 
59
  #reload)
 
60
        #
 
61
        #       If the daemon can reload its config files on the fly
 
62
        #       for example by sending it SIGHUP, do it here.
 
63
        #
 
64
        #       If the daemon responds to changes in its config file
 
65
        #       directly anyway, make this a do-nothing entry.
 
66
        #
 
67
        # echo "Reloading $DESC configuration files."
 
68
        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
 
69
        #       /var/run/$NAME.pid --exec $DAEMON
 
70
  #;;
 
71
  restart|force-reload)
 
72
        #
 
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".
 
76
        #
 
77
        echo -n "Restarting $DESC: "
 
78
        #start-stop-daemon --stop --quiet --pidfile \
 
79
        #       /var/run/$NAME.pid --exec $DAEMON
 
80
        #sleep 1
 
81
        #start-stop-daemon --start --quiet --pidfile \
 
82
        #       /var/run/$NAME.pid --exec $DAEMON
 
83
        #echo "$NAME."
 
84
        $0 stop
 
85
        sleep 3
 
86
        $0 start
 
87
        ;;
 
88
  *)
 
89
        N=/etc/init.d/$NAME
 
90
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
 
91
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
92
        exit 1
 
93
        ;;
 
94
esac
 
95
 
 
96
exit 0