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

« back to all changes in this revision

Viewing changes to debian/rc.zoneserver

  • 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
 
NAME="zoneserver"
17
 
DESC="zoneserver"
18
 
 
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.
22
 
#
23
 
SERVERS="/etc/maradns/mararc"
24
 
 
25
 
test -f $DAEMON || exit 0
26
 
 
27
 
set -e
28
 
 
29
 
case "$1" in
30
 
  start)
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 &
38
 
            else
39
 
                echo "No zone ACL's configured for $rcfile -- not starting zoneserver for it."
40
 
            fi
41
 
        done
42
 
        echo "$NAME."
43
 
        ;;
44
 
  stop)
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 \
51
 
                    $DAEMON
52
 
            fi
53
 
        done
54
 
        echo "$NAME."
55
 
        ;;
56
 
  #reload)
57
 
        #
58
 
        #       If the daemon can reload its config files on the fly
59
 
        #       for example by sending it SIGHUP, do it here.
60
 
        #
61
 
        #       If the daemon responds to changes in its config file
62
 
        #       directly anyway, make this a do-nothing entry.
63
 
        #
64
 
        # echo "Reloading $DESC configuration files."
65
 
        # start-stop-daemon --stop --signal 1 --quiet --pidfile \
66
 
        #       /var/run/$NAME.pid --exec $DAEMON
67
 
  #;;
68
 
  restart|force-reload)
69
 
        #
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".
73
 
        #
74
 
        echo -n "Restarting $DESC: "
75
 
        #start-stop-daemon --stop --quiet --pidfile \
76
 
        #       /var/run/$NAME.pid --exec $DAEMON
77
 
        #sleep 1
78
 
        #start-stop-daemon --start --quiet --pidfile \
79
 
        #       /var/run/$NAME.pid --exec $DAEMON
80
 
        #echo "$NAME."
81
 
        $0 stop
82
 
        sleep 3
83
 
        $0 start
84
 
        ;;
85
 
  *)
86
 
        N=/etc/init.d/$NAME
87
 
        # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
88
 
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
89
 
        exit 1
90
 
        ;;
91
 
esac
92
 
 
93
 
exit 0