From f6f2d51fa9e89554604c75cc99a820ce4ebbb80d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Mon, 12 Sep 2011 13:50:21 +0200 Subject: [PATCH] flush output file handle and send kill to whole process group --- PVE/RPCEnvironment.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/PVE/RPCEnvironment.pm b/PVE/RPCEnvironment.pm index a18ceb1..007c3c4 100644 --- a/PVE/RPCEnvironment.pm +++ b/PVE/RPCEnvironment.pm @@ -530,7 +530,7 @@ sub fork_worker { kill('KILL', $$); } - # sync with parent (signal that we are read) + # sync with parent (signal that we are ready) if ($sync) { print "$upid\n"; } else { @@ -632,6 +632,7 @@ sub fork_worker { } if ($outfh) { print $outfh $line; + $outfh->flush(); } } } @@ -653,10 +654,10 @@ sub fork_worker { if ($outfh) { print $outfh "TASK ERROR: $err\n"; } - kill (15, $cpid); + kill (-15, $cpid); } else { - kill (9, $cpid); # make sure it gets killed + kill (-9, $cpid); # make sure it gets killed } close($outfh); -- 2.39.2