Re: [dwm] patch to not reparent children to init

From: Neale Pickett <neale_AT_woozle.org>
Date: Thu, 06 Nov 2008 14:52:37 -0700

"Anselm R Garbe" <garbeam_AT_gmail.com> writes:

> Well, I remember there was a problem with the SIGCHLD signal handler,
> I need to recheck with Stevens tomorrow. It might be that this was on
> some ancient UNIX though. But the double-fork is definately the most
> portable solution.

Page 267 in Stevens. I can't recall ever working with a UNIX where
SIGCHLD wasn't sent, process control in such an environment would be
next to impossible.

Maybe the older code was doing this:

  signal(SIGCHLD, SIG_IGN)

which is a trick of POSIX.1-2001 to not create zombies. If you'd tried
this (which would have worked on Linux, I think), it would have piled up
zombies on anything not conformant to that standard. If you have a
Linux box, this is in the NOTES section of the sigaction(2) man page.

I assert that my SIGCHLD solution is just as portable as the
double-fork, and is more appropriate, since the double-fork is usually
only done in daemons.

In fact, the only reason reparenting to init (with the double-fork)
works is because init calls wait() in its SIGCHLD handler :)

Neale
Received on Thu Nov 06 2008 - 21:52:37 UTC

This archive was generated by hypermail 2.2.0 : Thu Nov 06 2008 - 22:00:05 UTC