[Bug 406397] Re: init: job stuck with expect fork/daemon when parent reaps child

MarcS 406397 at bugs.launchpad.net
Tue May 27 09:17:39 CEST 2014


I ran into this again and found a new (?) way of fixing the situation
once it has happened that is slightly less crazy than the exhaust-all-
pids script: The /proc/sys/kernel/ns_last_pid knob can be used to get a
process with the correct PID.

I used
echo $(($n-2)) | sudo tee /proc/sys/kernel/ns_last_pid && bash -c 'sleep 60 &'

Where $n is the PID that upstart is tracking (output of 'status'). The
-2 is necessary because the bash process gets a pid first. The sleep
should wind up with the tracked PID and as a child of the init process.

Maybe there is a simpler way, but this worked for me.

Note that is a relatively "new" kernel feature. It works with the saucy
kernel, I don't know about earlier releases.

-- 
You received this bug notification because you are subscribed to PLD
Linux.
https://bugs.launchpad.net/bugs/406397

Title:
  init: job stuck with expect fork/daemon when parent reaps child

Status in Upstart:
  Triaged
Status in “upstart” package in Ubuntu:
  Invalid
Status in “upstart” package in Debian:
  Confirmed
Status in PLD Linux Distribution:
  New

Bug description:
  Hi

  Wrong use of the expect fork stanza can create job with status
    job stop/killled, process nnn
  without any process nnn running on the system.

  As an example the following avahi.conf should have used
  "expect daemon", but will instead create a stuck job.

  stop on stopping dbus-system
  respawn
  expect fork
  exec avahi-daemon -D

  /Emil Renner Berthing

To manage notifications about this bug go to:
https://bugs.launchpad.net/upstart/+bug/406397/+subscriptions


More information about the pld-bugs mailing list