]>
git.ipfire.org Git - thirdparty/pdns.git/blob - builder-support/debian/recursor/debian-jessie/pdns-recursor.init
63390cf4489fb0676a70485a68e2063fce0c10f8
3 # Provides: pdns-recursor
4 # Required-Start: $network $remote_fs $syslog
5 # Required-Stop: $network $remote_fs $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: PowerDNS Recursor - Recursive DNS Server
9 # Description: PowerDNS Recursor - Recursive DNS Server
13 # Authors: Matthijs Möhlmann <matthijs@cacholong.nl>
14 # Christoph Haas <haas@debian.org>
17 # Thomas Hood <jdthood@aglu.demon.nl>
19 # initscript for PowerDNS recursor
21 # Load lsb stuff for systemd redirection (if available).
22 if [ -e /lib
/lsb
/init-functions
]; then
23 .
/lib
/lsb
/init-functions
26 PATH
=/sbin
:/bin
:/usr
/sbin
:/usr
/bin
27 DESC
="PowerDNS Recursor"
29 DAEMON
=/usr
/sbin
/$NAME
30 # Derive the socket-dir setting from /etc/powerdns/recursor.conf
31 # or fall back to the default /var/run if not specified there.
32 PIDDIR
=$
(awk -F= '/^socket-dir=/ {print $2}' /etc
/powerdns
/recursor.conf
)
33 if [ -z "$PIDDIR" ]; then PIDDIR
=/var
/run
; fi
34 PIDFILE
=$PIDDIR/$NAME.pid
36 # Gracefully exit if the package has been removed.
37 test -x $DAEMON ||
exit 0
39 # Read config file if it is present.
40 if [ -r /etc
/default
/pdns-recursor
]; then
41 .
/etc
/default
/pdns-recursor
46 # 0 if daemon has been started / was already running
47 # >0 if daemon could not be started
48 start-stop-daemon
--start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev
/null ||
return 0
49 start-stop-daemon
--start --oknodo --quiet --pidfile $PIDFILE --exec $DAEMON -- --daemon=yes ||
return 2
53 if [ "X$RESOLVCONF" = "Xyes" ] && [ -x /sbin
/resolvconf
]; then
54 echo "nameserver 127.0.0.1" |
/sbin
/resolvconf
-a lo.pdns-recursor
61 # 0 if daemon has been stopped
62 # 1 if daemon was already stopped
63 # 2 if daemon could not be stopped
64 # other if a failure occured
65 start-stop-daemon
--stop --quiet --pidfile $PIDFILE --name $NAME
67 [ "$RETVAL" = 2 ] && return 2
73 if [ "X$RESOLVCONF" = "Xyes" ] && [ -x /sbin
/resolvconf
]; then
74 /sbin
/resolvconf
-d lo.pdns-recursor
81 /usr
/bin
/rec_control
ping > /dev
/null
87 if [ "$START" != "yes" ]; then
88 echo "Not starting $DESC -- disabled."
91 echo -n "Starting $DESC: $NAME ..."
100 echo "already running"
111 echo -n "Stopping $DESC: $NAME ..."
128 restart|force-reload
)
129 if [ "$START" != "yes" ]; then
133 echo -n "Restarting $DESC ..."
144 echo "failed -- old process still running"
148 echo "failed to start"
154 echo "failed to stop"
161 echo "$NAME is running"
164 echo "$NAME is not running or not responding"
169 echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2