sen TERM to all pgrp members
authorDietmar Maurer <dietmar@proxmox.com>
Tue, 18 Oct 2011 05:47:09 +0000 (07:47 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Tue, 18 Oct 2011 05:47:09 +0000 (07:47 +0200)
PVE/RPCEnvironment.pm

index 0905b65..5806107 100644 (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++;
            };