Cleaning up after your children

Randal L. Schwartz merlyn at
Tue Oct 16 03:12:35 CDT 2001

>>>>> "josh" == josh hoblitt <jhoblitt at> writes:

josh> I'm working on a small preforking (like apache) webserver. I'd like to
josh> have the children pass information about their present status to the
josh> parent.  After having trouble getting IO::Select to work correctly I
josh> posted to begginers at perl.  With some help I'v gotten it atleast somewhat
josh> working with examples from the perl cookbook and perlipc thrown
josh> together.  I'm still having two difficulties... one the only way I can
josh> seem to avoid having some defunct children is to set $SIG{CHLD} =
josh> 'IGNORE'.  I do not want to do this because I'm dependant on the signal
josh> to know when to fork a replacement child.

Have you looked at the columns I pointed you at?

josh>   Is there someway to guarentee
josh> trapping signals and they won't be ignored while dealing with a prevous
josh> signal.  

No.  And remember what I already told you (I think)... if two kids
both die at the same time, you'll get one SIGCHLD, not two.

Look at the columns.  Read the associated explanatory text.  Don't
reinvent the wheel until you've studied prior art.

See col15 in <> for example.

Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at> <URL:>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See for onsite and open-enrollment Perl training!

More information about the Pdx-pm-list mailing list