http://qs1969.pair.com?node_id=79785


in reply to Re: Re: Re: Have children maintain themselves or main script maintain children.
in thread Have children maintain themselves or main script maintain children.

Thanks for the explanation. We HAVE run into your first bulletpoint. We had some children come back that gave us the pid instead of 0 or -1 and had to work around that. So, I can understand your explanation there.

for instance the section on a preforking daemon

I'm almost positive (I don't have the book here with me today.) that the preforking daemon is the major example we used and you're right, it does not have the waitpid. We got lucky and found that in a post on good old PM.

Personally I would ignore SIGCHLD and make the parent wait() for the children to die. It will be nicely blocked (ie not using any excess CPU) until it needs to do something (ie make more children).

gr0k and I were just talking about that. I think my weekend project has just shown up. :)

Thanks to everybody that has helped out with this node.