[Zope] Parent process gone but children remain
Chris McDonough
chrism at plope.com
Wed Mar 16 13:43:48 EST 2005
> We use Webmin and can type in the path to the files that launched the processes and then kill off the detached children. Then start the zeo client again and all is fine.
>
> First...How can the parent die off and the children remain?
Parents in unix are responsible (this is actually the technical term for
it, I'm not sick) for "reaping their dead children". This doesn't
happen automatically, someone needs to ensure they code it in. If the
parent process dies before calling "waitpid" on its children (or if it
never calls waitpid on its children), the children live on (sometimes
they can become "zombie" processes).
> Second...how can I make sure (using a command or shell script) that the children are cleaned up if the parent process dies or we stop the service by hand or through use of the zopectl stop command? Similar to the way webmin does it with its Process Search tool by finding all the parts and 'killing' them off.
Sounds like zopectl needs to be fixed in some way to reap its children
if it dies.
FWIW, I use "supervisor" to do this instead of zopectl (see
http://www.plope.com/software/supervisor/) . It seems to work most of
the time, although I have seen cases where the supervisord parent dies
and the children live on, so there's still a bug lurking there somewher.
- C
More information about the Zope
mailing list