Package:  olsrd
Version:  0.4.10-1
Severity: important
Tags:     patch
User:     initscripts-ng-de...@lists.alioth.debian.org
Usertags: incorrect-dependency incorrect-runlevels
User:     debian...@lists.debian.org
Usertags: piuparts

With dependency based boot sequencing, I discovered what I believe is
a bug in the init.d script of this package.  The init.d script depend
on networking and ifupdown, while the package do not depend on the
packages providing these scripts.  This break installation of the
package on systems where networking and ifupdown isn't installed.  It
is better to depend on the virtual facility $network.  Further, the
script uses files in /usr/ but do not depend on $remote_fs.  This make
the script start before /usr/ is mounted when it is on NFS.  Last, but
runlevels listed in the init.d header do not match the arguments used
to update-rc.d.  I assume the latter is correct.  The script used to
start after the syslog was operational, and I suspect it should
continue to do so.

The installation problem was discovered by piuparts, see
<URL: http://piuparts.debian.org/sid/fail/olsrd_0.5.6-r5-1.log > for
the test log.  These are the error messages:

  update-rc.d: warning: olsrd start runlevel arguments (2 3 4 5) do not match 
LSB Default-Start values (S)
  update-rc.d: warning: olsrd stop runlevel arguments (0 1 6) do not match LSB 
Default-Stop values (0 6)
  insserv: Service networking has to be enabled to start service olsrd
  insserv: Service ifupdown has to be enabled to start service olsrd
  insserv: exiting now!

This patch should solve the issue.  The postinst part is to make sure
existing systems with the incorrect runlevel settings are fixed during
upgrade.

diff -urN ../olsrd-0.5.6-r5/debian/olsrd.init 
../olsrd-0.5.6-r5-pere/debian/olsrd.init
--- ../olsrd-0.5.6-r5/debian/olsrd.init 2009-09-27 17:27:08.000000000 +0200
+++ ../olsrd-0.5.6-r5-pere/debian/olsrd.init    2009-09-27 17:31:26.000000000 
+0200
@@ -1,10 +1,10 @@
 #! /bin/sh
 ### BEGIN INIT INFO
 # Provides:          olsrd
-# Required-Start:    networking ifupdown $local_fs
-# Required-Stop:     $local_fs
-# Default-Start:     S
-# Default-Stop:      0 6
+# Required-Start:    $network $remote_fs $syslog
+# Required-Stop:     $network $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: /etc/init.d/olsrd: start olsrd
 ### END INIT INFO

diff -urN ../olsrd-0.5.6-r5/debian/olsrd.postinst 
../olsrd-0.5.6-r5-pere/debian/olsrd.postinst
--- ../olsrd-0.5.6-r5/debian/olsrd.postinst     1970-01-01 01:00:00.000000000 
+0100
+++ ../olsrd-0.5.6-r5-pere/debian/olsrd.postinst        2009-09-27 
17:35:55.000000000 +0200
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+set -e
+
+# Recover from incorrect init.d script headers in version 0.5.6-r5-1 and 
earlier
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "0.5.6-r5-1" \
+   && [ -f /etc/rcS.d/S[0-9][0-9]olsrd ] \
+   && ! [ -f /etc/rc2.d/S[0-9][0-9]olsrd ] ; then
+    update-rc.d -f olsrd remove
+fi
+
+#DEBHELPER#

Happy hacking,
-- 
Petter Reinholdtsen



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to