2 # pdns This is controller stript for PowerDNS name server.
6 # description: pdns is is a Domain Name Server (DNS) \
7 # that is used to resolve host names to IP addresses.
9 # Source function library
10 . /etc/rc.d/init.d/functions
12 # Source networking configuration
13 . /etc/sysconfig/network
15 # Check that networking is up.
16 if is_yes "${NETWORKING}"; then
17 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
18 msg_network_down "PowerDNS"
30 suffix=`basename $0 | awk -F- '{print $2}'`
32 EXTRAOPTS=--config-name=$suffix
38 pdns_server="/usr/sbin/pdns_server $EXTRAOPTS"
41 ret=$(/usr/bin/pdns_control $EXTRAOPTS $1 $2 2> /dev/null)
54 if test "$NOTRUNNING" = "0"; then
55 msg_stopping "PowerDNS"
56 doPC quit 2>&1 >/dev/null
57 [ $? -eq 0 ] && ok || fail
58 rm /var/lock/subsys/pdns
60 msg_not_running "PowerDNS"
64 run_cmd "Killing PowerDNS without grace" killall -v -9 pdns_server
67 if test "$NOTRUNNING" = "0"; then
68 msg_already_running "PowerDNS"
70 msg_starting "PowerDNS (Powered DNS server)"
71 daemon $pdns_server --daemon --guardian=yes
73 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns
78 run_cmd "PowerDNS (3 sec. timeout)" sleep 3
83 if test "$NOTRUNNING" = "0"; then
84 show "Reloading PowerDNS"
85 doPC cycle 2>&1 >/dev/null
93 msg_not_running "PowerDNS" >&2
98 if test "$NOTRUNNING" = "0"; then
99 msg_already_running "PowerDNS"
101 show "PowerDNS in foreground (testing mode)"
102 $pdns_server --daemon=no --guardian=no --control-console --loglevel=9
106 if test "$NOTRUNNING" = "0"; then
110 msg_not_running "PowerDNS"
114 if [ $# -lt 2 ]; then
115 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
118 if test "$NOTRUNNING" = "0"; then
120 doPC show $2 ; echo $ret
122 msg_not_running "PowerDNS"
126 if [ $# -lt 2 ]; then
127 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
130 if test "$NOTRUNNING" = "0"; then
131 doPC show $2 ; echo $ret
132 if [ "$3x" != "x" ]; then
133 doPC show $3 ; echo $ret
137 doPC uptime ; echo $ret
140 msg_not_running "PowerDNS" >&2
145 if [ $# -lt 2 ]; then
146 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
149 if test "$NOTRUNNING" = "0"; then
150 doPC show $2 ; echo $ret
152 msg_not_running "PowerDNS" >&2
157 msg_usage "$0 {start|stop|restart|reload|force-reload|status|dump|show|mrtg|cricket|monitor} [...]"