in reply to Killing a Forked Subprocess
Update: If signal selection is the real problem as merlyn and dws are pointing out, the below code might be overkill or just totally off the mark.
On *nix, you might be able to use setpgrp() to send a kill signal to the process group, not just the forked process
## pseudocode, so won't do any good as it is if( $i_am_the_child ) { setpgrp(); `some_cmd`; } else { ## parent sleep $sleepamt; ## I think 15 is SIGTERM. please confirm on ## on your system kill -15, getpgrp( $child_pid ); }
While I think the above idiom is correct, I suggest you read perldoc -f kill and setpgrp to make sure that that's what you want... ;)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Killing a Forked Subprocess
by IlyaM (Parson) on Mar 21, 2002 at 20:20 UTC | |
by lestrrat (Deacon) on Mar 21, 2002 at 20:32 UTC | |
by IlyaM (Parson) on Mar 21, 2002 at 20:44 UTC | |
|
Re: Re: Killing a Forked Subprocess
by Super Monkey (Beadle) on Mar 21, 2002 at 19:32 UTC |