## 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 ); }