Package:  lxnm
Version:  0.2-1
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.  The script uses files in /usr/, but do
not depend on $remote_fs.  It should use the virtual facilities
instead of hardcoding dependencies on networking and ifupdown.  Also,
the runlevel list do not match the arguments used for update-rc.d, and
the script will fail to start in runlevels 3-5.

<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.  It include a postinst fragment to
recover the incorrect runlevel settings from already installed
systems.

diff -urN ../lxnm-0.2.2+svn20080909/debian/lxnm.init 
../lxnm-0.2.2+svn20080909-pere/debian/lxnm.init
--- ../lxnm-0.2.2+svn20080909/debian/lxnm.init  2009-09-20 22:35:25.000000000 
+0200
+++ ../lxnm-0.2.2+svn20080909-pere/debian/lxnm.init     2009-09-20 
22:36:45.000000000 +0200
@@ -1,9 +1,9 @@
 #! /bin/sh
 ### BEGIN INIT INFO
 # Provides:          lxnm
-# Required-Start:    networking ifupdown
-# Required-Stop:     $local_fs
-# Default-Start:     2
+# Required-Start:    $network $remote_ds $syslog
+# Required-Stop:     $network $remote_fs $syslog
+# Default-Start:     2 3 4 5
 # Default-Stop:      0 1 6
 # Short-Description: /etc/init.d/lxnm: start lxnm
 ### END INIT INFO
diff -urN ../lxnm-0.2.2+svn20080909/debian/lxnm.postinst 
../lxnm-0.2.2+svn20080909-pere/debian/lxnm.postinst
--- ../lxnm-0.2.2+svn20080909/debian/lxnm.postinst      1970-01-01 
01:00:00.000000000 +0100
+++ ../lxnm-0.2.2+svn20080909-pere/debian/lxnm.postinst 2009-09-20 
22:42:13.000000000 +0200
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+set -e
+
+# Those using dependency based boot sequencing with sysv-rc and
+# installing lxnm using version 0.2.2+svn20080909-3 and earlier would
+# have the wrong runlevel symlinks.  Recover from this.
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le 
"0.2.2+svn20080909-3" \
+   && [ -f /etc/rc2.d/S[0-9][0-9]lxnm ] && [ ! -f /etc/rc3.d/S[0-9][0-9]lxnm ]
+then
+   update-rc.d -f lxnm remove
+fi
+
+#DEBHELPER#

Happy hacking,
-- 
Petter Reinholdtsen



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

Reply via email to