On 10/29/06, Nathaniel Smith <[EMAIL PROTECTED]> wrote:
> >Fork a child, which forks a grandchild and exits. Grandchild execs > >what you really wanted to run. wait() returns for the child, and the > >grandchild gets reparented to init. > > This seems a bit of a hack when a simple solution is easy. > > Just do this for POSIX systems (I don't believe there is a problem > with zombie processes on other systems):
...
But this technique is what I meant by "unconditionally get rid of zombies" -- I'm not sure what happens when you have a signal handler like this, _and_ you sometimes want to call waitpid() in your program explicitly.
waitpid() will always fail, is what. Hence the double fork trick. (I don't think using an external daemon(1) executable is appropriate, though it might be sensible to do what it does in that intermediate process - close file descriptors, call setsid(), that sort of thing.) zw _______________________________________________ Monotone-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/monotone-devel
