[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] $SIG{'HUP'}
- Subject: [ale] $SIG{'HUP'}
- From: cfowler at outpostsentinel.com (Christopher Fowler)
- Date: Thu May 26 15:09:55 2005
The child that gets executed after a SIGHUP ignores SIGHUP. What is the
best way to fix in Perl?
$SIG{'HUP'} = sub {
_print "Recevied SIGHUP! Restarting.\n";
# Kill all the children
my @goners = ();
foreach my $ref (keys %GordonKapes) {
push @goners, $GordonKapes{$ref}{'PID'};
}
$TERMINATION = 1;
kill 9, @goners;
my $pid = fork();
exit 0 if $pid;
# Allow things to settle down;
sleep(1);
exec ("/opt/SAM/gk/gkd.pl") or die "$!\n";
};
Thanks,
Chris