Package:  pdns-recursor
Version:  3.1.3-1
Severity: important
Tags:     patch
User:     [email protected]
Usertags: incorrect-dependency

With dependency based boot sequencing, I discovered what I believe is
a bug in the init.d script.  The script have a hard dependency on the
networking script, but do not depend on net-base.  It would be better
to depend on the virtual $network facility.  Next, the script depend
on files in /usr/, and should depend on $remote_fs, not $local_fs.
Last, the header runlevel list do not match the arguments used for
update-rc.d, and the missing stop entry for runlevel 1 will make the
script fail to restart when switching from runlevel 1 to 2-5.

I discovered the problem by reading
<URL: http://piuparts.debian.org/sid/fail/pdns-recursor_3.1.7.1-2.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 fix the issues.  Setting severity important, as the
net-base package is installed on almost all Debian installations.

diff -ur pdns-recursor-3.1.7.1/debian/init.d/pdns-recursor 
pdns-recursor-3.1.7.1-pere/debian/init.d/pdns-recursor
--- pdns-recursor-3.1.7.1/debian/init.d/pdns-recursor   2009-09-16 
22:35:51.000000000 +0200
+++ pdns-recursor-3.1.7.1-pere/debian/init.d/pdns-recursor      2009-09-16 
22:36:19.000000000 +0200
@@ -1,10 +1,10 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:          pdns-recursor
-# Required-Start:    networking
-# Required-Stop:     networking
+# Required-Start:    $network $remote_fs
+# Required-Stop:     $network $remote_fs
 # Default-Start:     2 3 4 5
-# Default-Stop:      0 6
+# Default-Stop:      0 1 6
 # Short-Description: Start the recursor at boot time.
 ### END INIT INFO

diff -ur pdns-recursor-3.1.7.1/debian/pdns-recursor.postinst 
pdns-recursor-3.1.7.1-pere/debian/pdns-recursor.postinst
--- pdns-recursor-3.1.7.1/debian/pdns-recursor.postinst 2009-09-16 
22:35:51.000000000 +0200
+++ pdns-recursor-3.1.7.1-pere/debian/pdns-recursor.postinst    2009-09-16 
22:42:45.000000000 +0200
@@ -34,6 +34,15 @@
   rm -f /etc/init.d/pdns_recursor
 fi

+# Those using dependency based boot sequencing with sysv-rc and
+# installing pdns-recursor version 3.1.7.1-2 or earlier would have wrong
+# runlevel symlinks.  Recover from this.
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "3.1.7.1-2" \
+   && [ -f /etc/rc2.d/S[0-9][0-9]pdns-recursor ] && [ ! -f 
/etc/rc1.d/K[0-9][0-9]pdns-recursor ]
+then
+    update-rc.d -f pdns-recursor remove
+fi
+
 if [ -x "/etc/init.d/pdns-recursor" ]; then
   update-rc.d pdns-recursor defaults 19 85 >/dev/null
   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