[Pdns-dev] run init script with set -e

Marc Haber mh+pdns-dev at zugschlus.de
Tue Nov 8 12:09:49 CET 2011


Hi,

the following patch makes the init script run with set -e, as mandated
by Debian policy. Even outside of Debian, I consider this a good idea
and would suggest applying the patch to the pdns release as well.

--- pdns/pdns.in        (revision 2296)
+++ pdns/pdns.in        (working copy)
@@ -14,6 +14,8 @@
 # Description:       Start/stop PowerDNS authoritative server
 ### END INIT INFO

+set -e
+
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 BINARYPATH=@bindir@
@@ -41,10 +43,9 @@
        ret=$($BINARYPATH/pdns_control $EXTRAOPTS $1 $2 2> /dev/null)
 }

+NOTRUNNING=0
+doPC ping || NOTRUNNING=$?

-doPC ping
-NOTRUNNING=$?
-
 case "$1" in
        status)
                if test "$NOTRUNNING" = "0"
@@ -80,8 +81,7 @@
                then
                        echo "already running"
                else
-                       $pdns_server --daemon --guardian=yes
-                       if test "$?" = "0"
+                       if $pdns_server --daemon --guardian=yes
                        then
                                echo "started"
                        fi

Grüße
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 31958061
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 31958062


More information about the Pdns-dev mailing list