init not processing SIGCHLD during reboot?

Paul Smith psmith at netezza.com
Sat Dec 2 20:35:29 UTC 2006


On Sat, 2006-12-02 at 12:13 -0500, Rob Landley wrote:

> > 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.

As I mentioned in one of my earlier emails, this is not portable.
Although current versions of the POSIX/SUS spec require SIGCHLD set to
SIG_IGN to reap children, older versions of POSIX did not require that;
in fact the behavior was undefined (ditto for BSD).

I'm not sure what the portability requirements are for BusyBox, but it's
not difficult at all to handle this without resorting to SIG_IGN so we
might as well do so.

I'll send a patch tomorrow or Monday.

Cheers!



More information about the busybox mailing list