Bug#548550: brltty: Incorrect dependencies in init.d LSB header
Package: brltty
Version: 3.8-1
Severity: important
Tags: patch
User: initscripts-ng-devel@lists.alioth.debian.org
Usertags: incorrect-dependency
User: debian-qa@lists.debian.org
Usertags: piuparts
With dependency based boot sequencing, I discovered what I believe is
a bug in the init.d scripts of this package. The script have a hard
dependency on udev, yet the package do not depend on udev. I assume
the udev init.d script dependency should be a soft dependency. Also,
the header claim the script should stop in runlevels 0 and 6, yet the
arguments to update-rc.d state that it should only start and not stop.
I discovered these things from piuparts, which failed to install the
package. See
<URL:http://piuparts.debian.org/sid/fail/brltty_4.0-8.log>. Here are
the relevant parts:
update-rc.d: warning: brltty stop runlevel arguments (none) do not
match LSB Default-Stop values (0 6)
insserv: Service udev has to be enabled to start service brltty
insserv: exiting now!
I'm setting severity important and not serous, as udev is installed on
most systems and the error only trigger on systems without udev.
This patch should solve it, by making udev an optional dependency and
changing the stop symlinks. The postinst code is there to remove the
stop symlinks from existing installations which installed brltty when
dependency based boot sequencing was in effect, to allow the debhelper
added code to reinsert it at the correct location.
diff -ur ../brltty-4.0/debian/brltty.init ../brltty-4.0-pere/debian/brltty.init
--- ../brltty-4.0/debian/brltty.init 2009-09-27 08:10:32.000000000 +0200
+++ ../brltty-4.0-pere/debian/brltty.init 2009-09-27 08:17:11.000000000 +0200
@@ -1,12 +1,12 @@
#! /bin/sh
### BEGIN INIT INFO
# Provides: brltty
-# Required-Start: mountkernfs udev
-# Required-Stop:
-# Should-Start:
+# Required-Start: mountkernfs
+# Required-Stop:
+# Should-Start: udev
# Should-Stop:
# Default-Start: S
-# Default-Stop: 0 6
+# Default-Stop:
# Short-Description: Braille terminal driver
# Description: Used to provide access to refreshable braille terminals.
### END INIT INFO
diff -ur ../brltty-4.0/debian/brltty.postinst ../brltty-4.0-pere/debian/brltty.postinst
--- ../brltty-4.0/debian/brltty.postinst 2009-09-27 08:10:32.000000000 +0200
+++ ../brltty-4.0-pere/debian/brltty.postinst 2009-09-27 08:27:54.000000000 +0200
@@ -9,5 +9,13 @@
#update-rc.d brltty start 10 23 > /dev/null
+# Recover from incorrect init.d script headers in version 4.0-8 and earlier
+if [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "4.0-8" \
+ && [ -f /etc/rcS.d/S[0-9][0-9]brltty ] \
+ && [ -f /etc/rc0.d/K[0-9][0-9]brltty ] \
+ && [ -f /etc/rc6.d/K[0-9][0-9]brltty ] ; then
+ update-rc.d -f brltty remove
+fi
+
#DEBHELPER#
Happy hacking,
--
Petter Reinholdtsen
Reply to: