in reply to Child process dies

Well first off, SIGKILL (9) is untrappable and unignorable. You could choose to send SIGTERM (15) which has always been the *nicer* way to terminate a process. If you choose to do that, then you would need to setup a signal handler in your parent process that would then send a signal to the process group. (This, of course, all depends on how your platform handles signals and processes!):

#!/usr/local/bin/perl # parent code use strict; use warnings; my $pid; $SIG{TERM} = \&catch_sig; if( $pid = fork ) { # parent while( 1 ) { print "parent: $$, ", getpgrp, "\n"; sleep 2; } } else { exec ('./child.pl') or die "couldn't exec child.pl: $!"; } sub catch_sig { kill -15, getpgrp; exit; } #!/usr/local/bin/perl #child code --- nothing special here use strict; use warnings; while( 1 ) { print "child: $$, ", getpgrp, "\n"; sleep( 3 ); }
Now if you send kill -15 parent_process_id from the shell, the signal is trapped and then propagated to the group.

-derby