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 ]; then
18 msg_network_down "PowerDNS"
30 suffix=`basename $0 | awk -F- '{print $2}'`
33 EXTRAOPTS=--config-name=$suffix
39 pdns_server="/usr/sbin/pdns_server $EXTRAOPTS"
42 ret=$(/usr/sbin/pdns_control $EXTRAOPTS $1 $2 2> /dev/null)
51 if test "$NOTRUNNING" = "0" ; then
55 msg_not_running "PowerDNS"
61 if test "$NOTRUNNING" = "0"; then
62 msg_stopping "PowerDNS"
63 doPC quit 2>&1 >/dev/null
65 rm /var/lock/subsys/pdns
67 msg_not_running "PowerDNS"
73 run_cmd "Killing PowerDNS without grace" killall -v -9 pdns_server
77 if test "$NOTRUNNING" = "0"; then
78 msg_already_running "PowerDNS"
81 msg_starting "PowerDNS (Powered DNS server)"
82 daemon $pdns_server --daemon --guardian=yes
84 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/pdns
88 force-reload | restart)
90 run_cmd "PowerDNS (3 sec. timeout)" sleep 3
95 if test "$NOTRUNNING" = "0"; then
96 show "Reloading PowerDNS"
97 doPC cycle 2>&1 >/dev/null
100 msg_not_running "PowerDNS"
106 if test "$NOTRUNNING" = "0"; then
107 msg_already_running "PowerDNS"
109 show "PowerDNS in foreground (testing mode)"
110 $pdns_server --daemon=no --guardian=no --control-console --loglevel=9
115 if test "$NOTRUNNING" = "0"; then
119 msg_not_running "PowerDNS"
124 if [ $# -lt 2 ]; then
125 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
128 if test "$NOTRUNNING" = "0"; then
130 doPC show $2 ; echo $ret
132 msg_not_running "PowerDNS"
136 if [ $# -lt 2 ]; then
137 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
140 if test "$NOTRUNNING" = "0"; then
141 doPC show $2 ; echo $ret
142 if [ "$3x" != "x" ]; then
143 doPC show $3 ; echo $ret
147 doPC uptime ; echo $ret
150 msg_not_running "PowerDNS"
156 if [ $# -lt 2 ]; then
157 msg_usage "$0 {show|mrtg|cricket} <variable_name_from_pdns_dump>"
160 if test "$NOTRUNNING" = "0"; then
161 doPC show $2 ; echo $ret
163 msg_not_running "PowerDNS"
169 msg_usage "$0 {start|stop|reload|force-reload|restart|status|dump|show|mrtg|cricket|monitor} [...]"