debian-bugs-dist  

Bug#569032: Sends SIGUSR1 to init unconditionally, conflicts with upstart

Michael Biebl
Tue, 09 Feb 2010 08:06:36 -0800

Package: initscripts
Version: 2.87dsf-8
Severity: important
File: /etc/init.d/mountall.sh
Tags: patch

Hi,

mountall.sh contains this code:
        #
        # We might have mounted something over /dev, see if
        # /dev/initctl is there.
        #
        if [ ! -p $INITCTL ]
        then
                rm -f $INITCTL
                mknod -m 600 $INITCTL p
        fi
        kill -USR1 1

In upstart, the SIGUSR1 signal is used, to tell init  to reconnect to
the D-Bus system bus. This obviously conflicts with the above.
At the point where mountall.sh is run, dbus is not yet running, leading
to an error message when upstart is used.

Reading through the changelog, the above was apparently added when devfs
was used, so I'm unsure if it is still required today.

That said, attached is a proposed patch, which moves the kill inside the
if clause and additionally checks for /sbin/initctl, a binary that only
exists in the upstart package.

upstart does not require /dev/initctl, so the patch ensures what we
simply skip this step.

Please review and consider it for the next upload.

Cheers,
Michael

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.33-rc7 (SMP w/1 CPU core)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages initscripts depends on:
ii  coreutils                     8.4-1      GNU core utilities
ii  debianutils                   3.2.2      Miscellaneous utilities specific t
ii  libc6                         2.10.2-5   Embedded GNU C Library: Shared lib
ii  lsb-base                      3.2-23     Linux Standard Base 3.2 init scrip
ii  mount                         2.16.2-0   Tools for mounting and manipulatin
ii  sysv-rc                       2.87dsf-8  System-V-like runlevel change mech
ii  sysvinit-utils                2.87dsf-8  System-V-like utilities

Versions of packages initscripts recommends:
ii  e2fsprogs                     1.41.9-1   ext2/ext3/ext4 file system utiliti
ii  psmisc                        22.10-1    utilities that use the proc file s

initscripts suggests no packages.

-- no debconf information
diff --git a/debian/src/initscripts/etc/init.d/mountall.sh b/debian/src/initscripts/etc/init.d/mountall.sh
index ae70e96..0b66840 100755
--- a/debian/src/initscripts/etc/init.d/mountall.sh
+++ b/debian/src/initscripts/etc/init.d/mountall.sh
@@ -55,12 +55,12 @@ do_start() {
 	# We might have mounted something over /dev, see if
 	# /dev/initctl is there.
 	#
-	if [ ! -p $INITCTL ]
+	if [ ! -p $INITCTL ] && [ -x /sbin/initctl ]
 	then
 		rm -f $INITCTL
 		mknod -m 600 $INITCTL p
+		kill -USR1 1
 	fi
-	kill -USR1 1
 
 	#
 	# Execute swapon command again, in case we want to swap to