]> git.proxmox.com Git - qemu-server.git/commitdiff
API/clone: do not overwrite global signal handlers
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 6 Sep 2017 11:29:06 +0000 (13:29 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 7 Sep 2017 08:39:28 +0000 (10:39 +0200)
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 <t.lamprecht@proxmox.com>
PVE/API2/Qemu.pm

index 2f4a023f0cd96db6bbb63e051de27b2f09e860da..747172e21adbb73e23f3d45d7ac4316119755ccc 100644 (file)
@@ -2532,7 +2532,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);