[Pdns-dev] [patch] use invoke-rc.d in maintainer scripts

Marc Haber mh+pdns-dev at zugschlus.de
Wed Dec 14 09:10:46 CET 2011


Hi,

please consider the following patch which improves package robustness
in update situations. invoke-rc.d is Debian's preferred way to invoke
init scripts from maintainer scripts.

Index: debian-pdns/pdns.postinst
===================================================================
--- debian-pdns/pdns.postinst   (revision 2314)
+++ debian-pdns/pdns.postinst   (working copy)
@@ -11,9 +11,9 @@

 update_pdns() {
        if [ -n "$2" ] ; then
-               /etc/init.d/pdns start
+               invoke-rc.d pdns start
        else
-               /etc/init.d/pdns restart
+               invoke-rc.d pdns restart
        fi
 }

Index: debian-pdns/pdns.prerm
===================================================================
--- debian-pdns/pdns.prerm      (revision 2314)
+++ debian-pdns/pdns.prerm      (working copy)
@@ -3,5 +3,9 @@
 set -e

 if [ "$1" = "remove" ] ; then
-       /etc/init.d/pdns stop
+       if command -v invoke-rc.d >/dev/null 2>&1; then
+               invoke-rc.d pdns stop
+       else
+               /etc/init.d/pdns stop
+       fi
 fi

This patch is to be applied before the suggested renaming of
debian-pdns/ to debian/ in svn.

Greetings
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