init not processing SIGCHLD during reboot?

Rob Landley rob at landley.net
Sat Dec 2 17:13:45 UTC 2006


On Friday 01 December 2006 5:35 pm, Paul Smith wrote:
> Of course, once you look at the code life gets more complex :).

This is a big reason I try to focus on what I want the new code to do, rather 
than be unduly influenced by what the old code was doing.  (I generally try 
to figure out why it was doing it, but that's not the same as buying into 
it.)

> The loop in init starts any unstarted  RESPAWN and ASKFIRST commands, then
> it sleeps for one second, then it does a wait() to sleep until one of
> its children dies.

The reason init programs want to sit in a wait() loop is so that they can 
restart things that die.  But if all you want to do is reap zombies (such as 
during shutdown), set the SIGCHLD handler to SIG_IGNORE.

Rob
-- 
"Perfection is reached, not when there is no longer anything to add, but
when there is no longer anything to take away." - Antoine de Saint-Exupery



More information about the busybox mailing list