Package:  mumudvb
Version:  1.5.3-1
Severity: important
Tags:     patch
User:     initscripts-ng-de...@lists.alioth.debian.org
Usertags: incorrect-runlevels incorrect-dependencies

With dependency based boot sequencing, I discovered what I believe is
a bug in the init.d script.  The script start in rcS.d/ yet depend on
$syslog.  A closer look at the update-rc.d call indicate that the
runlevel list in the script header is wrong.  Also, the script depend
on files in /usr/, and should depend on $remote_fs instead of
$local_fs.

<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 solve the problem, and include code in the postinst to
recover installations with the wrong runlevel settings.  The version
number used need to be the last version before the issue is fixed.

diff -ur mumudvb-1.5.4/scripts/mumudvb.init 
mumudvb-1.5.4-pere/scripts/mumudvb.init
--- mumudvb-1.5.4/scripts/mumudvb.init  2009-03-29 23:10:09.000000000 +0200
+++ mumudvb-1.5.4-pere/scripts/mumudvb.init     2009-09-17 21:40:50.000000000 
+0200
@@ -1,10 +1,10 @@
 #!/bin/sh
 ### BEGIN INIT INFO
 # Provides:          mumudvb
-# Required-Start:    $local_fs $network $syslog
-# Required-Stop:
-# Default-Start:     S
-# Default-Stop:
+# Required-Start:    $remote_fs $network $syslog
+# Required-Stop:     $remote_fs $network $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
 # Short-Description: mumudvb
 # Description:       Digital television streaming program
 ### END INIT INFO
diff -ur mumudvb-1.5.4/debian/mumudvb.postinst 
mumudvb-1.5.4-pere/debian/mumudvb.postinst
--- mumudvb-1.5.4/debian/mumudvb.postinst       2009-09-17 21:39:21.000000000 
+0200
+++ mumudvb-1.5.4-pere/debian/mumudvb.postinst  2009-09-17 21:43:52.000000000 
+0200
@@ -38,6 +38,15 @@
     ;;
 esac

+# Those using dependency based boot sequencing with sysv-rc and
+# installing mumudvb using version 1.5.4-1 and earlier would have the
+# wrong runlevel symlinks.  Recover from this.
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "1.5.4-1" \
+   && [ -f /etc/rcS.d/S[0-9][0-9]mumudvb ] && [ ! -f 
/etc/rc2.d/S[0-9][0-9]mumudvb ]
+then
+   update-rc.d -f mumudvb remove
+fi
+
 # dh_installdeb will replace this with shell code automatically
 # generated by other debhelper scripts.


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