|
|
Subscribe / Log in / New account

Which init system for Debian?

Which init system for Debian?

Posted Nov 15, 2013 18:59 UTC (Fri) by nix (subscriber, #2304)
In reply to: Which init system for Debian? by smurf
Parent article: Which init system for Debian?

PID 1 gets all the SIGCHLD notifications about dead processes.
Actually it gets a basically random subset: that from processes whose parents have died. (Of course, if the parents haven't died, they should be cleaning things up...)

It is clear, though, that this decision was originally made explicitly so that init could do exactly the sort of respawning and tidying up job that sysvinit is so manifestly bad at.


to post comments

Which init system for Debian?

Posted Nov 15, 2013 20:52 UTC (Fri) by anselm (subscriber, #2796) [Link] (1 responses)

It is part of the initialisation protocol for Unix processes implementing background services to have themselves adopted by the init process just to make sure that the init process is notified when they exit.

That SysV init hasn't been doing anything with that information for the last 30 years or so is only too bad – but then again if you don't even know who your kids are in the first place, what are you going to do when they kick the bucket? Yay for systemd.

Which init system for Debian?

Posted Nov 15, 2013 23:50 UTC (Fri) by nix (subscriber, #2304) [Link]

... though, of course, if this information was actually useful systemd would be able to use it rather than cgroups.

What we really need is an option (inherited or systemwide, it doesn't matter) forcing *all* SIGCHLDs to go to PID 1, even if they also go to their real parent. But this is hard to implement in practice because the first thing you do on receipt of a SIGCHLD is reap the child, and you can't have two processes reaping the same child... not even a hack where PID 1's reap doesn't actually make the child go away if it has a live parent would work (the live parent could get to it first, leaving PID 1 with nothing to see).

Gah. Everything around child process management in Unix is just a horror. No wonder ptrace(), which builds on it in a halfwitted and agonizing fashion and has just the same problem with a process with 'two parents', is so horrible to use.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds