in reply to children don't see ^C ??
You'll probably want to put some sleep()s in there to watch it at work, but I'm sure you get the gist of it.use strict; my @children = (); $SIG{INT} = sub { kill 15, @children if @children > 0; print STDERR "children sent TERM signal\n"; exit 1; }; if(my $pid = fork()) { push @children, $pid; print "forked off child $pid\n"; } else { print "in child process\n"; }
broquaint
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: children don't see ^C ??
by iza (Monk) on Oct 11, 2001 at 12:44 UTC |