monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] auto updates


From: Zack Weinberg
Subject: Re: [Monotone-devel] auto updates
Date: Sun, 29 Oct 2006 17:14:58 -0800

On 10/29/06, Nathaniel Smith <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]