Package:  pdns-server
Version:  2.9.20-6
Severity: important
Tags:     patch
User:     [email protected]
Usertags: incorrect-dependency incorrect-runlevels

With dependency based boot sequencing, I discovered what I believe is
a bug in the init.d scripts of this package.  The script uses files in
/usr/, and should depend on $remote_fs.  The script used to start
after syslog, and should probably depend on $syslog.  The header do
not list runlevel 1, while the update-rc.d arguments specify that the
script should stop in runlevel 1.  Further, with a hard dependency on
networking instead of $network, the package fail to install when the
netbase package isn't installed.  The latter was discovered by
piuparts.  See
<URL: http://piuparts.debian.org/sid/fail/pdns-server_2.9.22-1+b1.log >
for the test log.

<URL: 
http://refspecs.freestandards.org/LSB_2.1.0/LSB-generic/LSB-generic/initscrcomconv.html
 >
documents the LSB header format.  Some debian notes are available from
<URL: http://wiki.debian.org/LSBInitScripts >.

This patch should solve the issue.  Without it, the package fail to
install when netbase isn't installed, and might start a bit too early
during boot.  It will also fail to stop the service properly when
switching to runlevel 1.

diff -ur ../pdns-2.9.22/debian/init.d/pdns 
../pdns-2.9.22-pere/debian/init.d/pdns
--- ../pdns-2.9.22/debian/init.d/pdns   2009-09-25 11:15:42.000000000 +0200
+++ ../pdns-2.9.22-pere/debian/init.d/pdns      2009-09-25 11:17:44.000000000 
+0200
@@ -1,10 +1,10 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:          pdns
-# Required-Start:    networking
-# Required-Stop:     networking
+# Required-Start:    $network $remote_fs $syslog
+# Required-Stop:     $network $remote_fs $syslog
 # Default-Start:     2 3 4 5
-# Default-Stop:      0 6
+# Default-Stop:      0 1 6
 # Short-Description: PDNS is a versatile high performance authoritative 
nameserver.
 ### END INIT INFO

diff -ur ../pdns-2.9.22/debian/pdns-server.postinst 
../pdns-2.9.22-pere/debian/pdns-server.postinst
--- ../pdns-2.9.22/debian/pdns-server.postinst  2009-09-25 11:15:42.000000000 
+0200
+++ ../pdns-2.9.22-pere/debian/pdns-server.postinst     2009-09-25 
11:22:29.000000000 +0200
@@ -113,6 +113,13 @@
   ;;
 esac

+# Recover from incorrect init.d script headers in version 2.9.22-1 and earlier
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "2.9.22-1" \
+   && [ -f /etc/rc0.d/K[0-9][0-9]pdns ] \
+   && ! [ -f /etc/rc1.d/K[0-9][0-9]pdns ] ; then
+  update-rc.d -f pdns remove
+fi
+
 if [ -x "/etc/init.d/pdns" ]; then
   update-rc.d pdns defaults 20 85 >/dev/null || exit 0
   if [ -x /usr/sbin/invoke-rc.d ]; then

Happy hacking,
--
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to