Search
j0ke.net Open Build Service
>
Projects
>
home:opeter
:
powerdns33_centos6
>
powerdns
> pdns-init.patch
Sign Up
|
Log In
Username
Password
Cancel
Overview
Repositories
Revisions
Requests
Users
Advanced
Attributes
Meta
File pdns-init.patch of Package powerdns
diff -ru pdns-3.2/pdns/pdns.in pdns-3.2.fresh/pdns/pdns.in --- pdns/pdns.in.orig 2013-05-22 08:23:55.921220023 +0200 +++ pdns/pdns.in 2013-05-22 08:23:36.721292790 +0200 @@ -2,20 +2,33 @@ # chkconfig: - 80 75 # description: PDNS is a versatile high performance authoritative nameserver -prefix=/usr -exec_prefix=/usr -BINARYPATH=/usr/bin -SBINARYPATH=/usr/sbin -SOCKETPATH=/var/run - +### BEGIN INIT INFO +# Provides: pdns +# Required-Start: $remote_fs $network $syslog +# Required-Stop: $remote_fs $network $syslog +# Should-Start: $all +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop PowerDNS authoritative server +# Description: Start/stop PowerDNS authoritative server +### END INIT INFO + +set -e + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +BINARYPATH=@bindir@ +SBINARYPATH=@sbindir@ +SOCKETPATH=@socketdir@ [ -f "$SBINARYPATH/pdns_server" ] || exit 0 -cd $SOCKETPATH -suffix=`basename $0 | awk -F- '{print $2}'` - +[ -r /etc/default/pdns ] && . /etc/default/pdns -if [ $suffix ] +cd $SOCKETPATH +suffix=$(basename $0 | cut -d- -f2- -s) +if [ -n "$suffix" ] then EXTRAOPTS=--config-name=$suffix PROGNAME=pdns-$suffix @@ -30,9 +43,8 @@ ret=$($BINARYPATH/pdns_control $EXTRAOPTS $1 $2 2> /dev/null) } - -doPC ping -NOTRUNNING=$? +NOTRUNNING=0 +doPC ping || NOTRUNNING=$? case "$1" in status) @@ -42,6 +54,7 @@ echo $ret else echo "not running" + exit 3 fi ;; @@ -50,7 +63,6 @@ if test "$NOTRUNNING" = "0" then doPC quit - rm -f /var/lock/subsys/pdns echo $ret else echo "not running" @@ -61,7 +73,6 @@ force-stop) echo -n "Stopping PowerDNS authoritative nameserver: " killall -v -9 pdns_server - rm -f /var/lock/subsys/pdns echo "killed" ;; @@ -71,21 +82,28 @@ then echo "already running" else - $pdns_server --daemon --guardian=yes - if test "$?" = "0" + if $pdns_server --daemon --guardian=yes then - touch /var/lock/subsys/pdns echo "started" + else + echo "starting failed" + exit 1 fi fi ;; force-reload | restart) echo -n "Restarting PowerDNS authoritative nameserver: " - echo -n stopping and waiting.. - doPC quit - sleep 3 - echo done + if test "$NOTRUNNING" = "1" + then + echo "not running, starting" + else + + echo -n stopping and waiting.. + doPC quit + sleep 3 + echo done + fi $0 start ;; @@ -176,7 +194,7 @@ *) - echo pdns [start\|stop\|force-reload\|restart\|status\|dump\|show\|mrtg\|cricket\|monitor] + echo pdns [start\|stop\|force-reload\|reload\|restart\|status\|dump\|show\|mrtg\|cricket\|monitor] ;; esac