sen TERM to all pgrp members

This commit is contained in:
Dietmar Maurer 2011-10-18 07:47:09 +02:00
parent 8d6e045f21
commit 527b2e7aed

View File

@ -652,10 +652,12 @@ sub fork_worker {
my $int_count = 0;
eval {
local $SIG{INT} = local $SIG{QUIT} = local $SIG{TERM} = sub {
# always send signal to all pgrp members
my $kpid = -$cpid;
if ($int_count < 3) {
kill(15, $cpid); # send TERM signal
kill(15, $kpid); # send TERM signal
} else {
kill(9, $cpid); # send KILL signal
kill(9, $kpid); # send KILL signal
}
$int_count++;
};