in reply to automatically killing all child processes created in a script
Update: I think: use POSIX qw(sys_wait_h); is needed too.#kill zombie children $SIG{CHLD} = 'reaper'; while (1) { server code to accept new clients and fork()... } sub reaper { my ($kidpid); while (($kidpid = waitpid(-1,WNOHANG))>0 ) { print "Reaped $kidpid\n"; } close $client; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: automatically killing all child processes created in a script
by JavaFan (Canon) on Aug 21, 2009 at 23:08 UTC | |
by Marshall (Canon) on Aug 22, 2009 at 00:08 UTC | |
by JavaFan (Canon) on Aug 22, 2009 at 00:52 UTC | |
by Marshall (Canon) on Aug 22, 2009 at 02:48 UTC | |
by swartz (Beadle) on Aug 21, 2009 at 23:54 UTC |