[Pkg-sysvinit-devel] Bug#699523: sysvinit: postinst fails if several 'init' process are running (LXC)

Cyril Bouthors cyb at debian.org
Fri Feb 1 09:19:14 UTC 2013


Package: sysvinit
Version: 2.88dsf-39
Severity: important

Hi,

I can't upgrade to latest sysinit because the initscript fails:

% sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 67 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up sysvinit (2.88dsf-39) ...
/var/lib/dpkg/info/sysvinit.postinst: 41: kill: Illegal number: 3164 3141 3118 1
dpkg: error processing sysvinit (--configure):
 subprocess installed post-installation script returned error exit status 2
Errors were encountered while processing:
 sysvinit

The revelant code is :

        # PID of init; may not always be 1.  Use for sending signals
        # and checking if init is running.
        PID="$(pidof /sbin/init || echo 1)"
(...)
        if ! ischroot
        then
                kill -s USR1 "$PID"
        fi

And the corresponding 'set -x' output is :

+ pidof /sbin/init
+ PID=3164 3141 3118 1
(...)
+ ischroot
+ kill -s USR1 3164 3141 3118 1
/var/lib/dpkg/info/sysvinit.postinst: 41: kill: Illegal number: 3164 3141 3118 1

$PID contains multiple PIDs because several 'init' process are running on the
machine on distinct LXC containers:

% ps -C init  
  PID TTY          TIME CMD
    1 ?        00:00:04 init
 3118 ?        00:00:02 init
 3141 ?        00:00:02 init
 3164 ?        00:00:02 init

% pidof init
3164 3141 3118 1

I see several ways to fix this issue:
 - killall -s USR1 init
 - for pid in $PID; do kill -s USR1 "$PID"; done
 - PID="$(pidof -s init)"
 - a check on the number of process based on 'pgrep -c init'

Which way is the best?

I hope to see this issue fixed.

Regards,

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages sysvinit depends on:
ii  debianutils     4.3.4
ii  initscripts     2.88dsf-38
ii  libc6           2.13-38
ii  libselinux1     2.1.9-5
ii  libsepol1       2.1.4-3
ii  sysv-rc         2.88dsf-38
ii  sysvinit-utils  2.88dsf-38

sysvinit recommends no packages.

sysvinit suggests no packages.

-- no debconf information
-- 
 ,''`.
: :' :      Cyril Bouthors
`. `'         Debian.org
  `-



More information about the Pkg-sysvinit-devel mailing list