3 # description: PDNS is a versatile high performance authoritative nameserver
7 # Required-Start: $remote_fs $network $syslog
8 # Required-Stop: $remote_fs $network $syslog
11 # Default-Start: 2 3 4 5
13 # Short-Description: PowerDNS authoritative server
14 # Description: PowerDNS authoritative server
19 exec_prefix
=@exec_prefix@
22 SOCKETPATH
=@socketdir@
25 [ -f "$SBINARYPATH/pdns_server" ] ||
exit 0
27 [ -r /etc
/default
/pdns
] && .
/etc
/default
/pdns
29 [ "$START" = "no" ] && exit 0
31 # Make sure that /var/run exists
34 suffix
=$
(basename $0 | cut
-d- -f2- -s)
37 EXTRAOPTS
=--config-name=$suffix
43 pdns_server
="$SBINARYPATH/pdns_server $DAEMON_ARGS $EXTRAOPTS"
47 ret
=$
($BINARYPATH/pdns_control
$EXTRAOPTS $1 $2 2> /dev
/null
)
51 doPC
ping || NOTRUNNING
=$?
55 if test "$NOTRUNNING" = "0"
66 echo -n "Stopping PowerDNS authoritative nameserver: "
67 if test "$NOTRUNNING" = "0"
78 echo -n "Stopping PowerDNS authoritative nameserver: "
79 killall
-v -9 pdns_server
84 echo -n "Starting PowerDNS authoritative nameserver: "
85 if test "$NOTRUNNING" = "0"
87 echo "already running"
89 if $pdns_server --daemon --guardian=yes
93 echo "starting failed"
99 force-reload | restart
)
100 echo -n "Restarting PowerDNS authoritative nameserver: "
101 if test "$NOTRUNNING" = "1"
103 echo "not running, starting"
106 echo -n stopping and waiting..
115 echo -n "Reloading PowerDNS authoritative nameserver: "
116 if test "$NOTRUNNING" = "0"
119 echo requested reload
127 if test "$NOTRUNNING" = "0"
129 echo "already running"
131 $pdns_server --daemon=no
--guardian=no
--control-console --loglevel=9
136 if test "$NOTRUNNING" = "0"
148 echo Insufficient parameters
151 if test "$NOTRUNNING" = "0"
154 doPC show
$2 ; echo $ret
163 echo Insufficient parameters
166 if test "$NOTRUNNING" = "0"
168 doPC show
$2 ; echo $ret
171 doPC show
$3 ; echo $ret
175 doPC uptime
; echo $ret
186 echo Insufficient parameters
189 if test "$NOTRUNNING" = "0"
191 doPC show
$2 ; echo $ret
201 echo pdns
[start\|stop\|force-reload\|reload\|restart\|status\|dump\|show\|mrtg\|cricket\|monitor
]