From d3395ba8c511cb5290cd747f5925d41950208c96 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Wed, 6 Sep 2017 13:29:06 +0200 Subject: [PATCH] API/clone: do not overwrite global signal handlers perls 'local' must be either used in front of each $SIG{...} assignments or they must be put in a list, else it affects only the first variable and the rest are *not* in local context. This may cause weird behaviour where daemons seemingly do not get terminating signals delivered correctly and thus may not shutdown gracefully anymore. Signed-off-by: Thomas Lamprecht --- PVE/API2/Qemu.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PVE/API2/Qemu.pm b/PVE/API2/Qemu.pm index 4cd3f437..5b703bd5 100644 --- a/PVE/API2/Qemu.pm +++ b/PVE/API2/Qemu.pm @@ -2493,7 +2493,10 @@ __PACKAGE__->register_method({ my $jobs = {}; eval { - local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = sub { die "interrupted by signal\n"; }; + local $SIG{INT} = + local $SIG{TERM} = + local $SIG{QUIT} = + local $SIG{HUP} = sub { die "interrupted by signal\n"; }; PVE::Storage::activate_volumes($storecfg, $vollist, $snapname);