mirror of
https://git.proxmox.com/git/qemu-server
synced 2025-10-04 20:48:29 +00:00
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. In all cases the global signal handlers we overwrote were in cli programs or forked workers, not in daemons.
This commit is contained in:
parent
d296ed08d3
commit
6cb0144ae3
@ -2697,7 +2697,10 @@ __PACKAGE__->register_method({
|
|||||||
my $newvollist = [];
|
my $newvollist = [];
|
||||||
|
|
||||||
eval {
|
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"; };
|
||||||
|
|
||||||
warn "moving disk with snapshots, snapshots will not be moved!\n"
|
warn "moving disk with snapshots, snapshots will not be moved!\n"
|
||||||
if $snapshotted;
|
if $snapshotted;
|
||||||
|
@ -5622,9 +5622,11 @@ sub restore_vma_archive {
|
|||||||
|
|
||||||
eval {
|
eval {
|
||||||
# enable interrupts
|
# enable interrupts
|
||||||
local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
|
local $SIG{INT} =
|
||||||
die "interrupted by signal\n";
|
local $SIG{TERM} =
|
||||||
};
|
local $SIG{QUIT} =
|
||||||
|
local $SIG{HUP} =
|
||||||
|
local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
|
||||||
local $SIG{ALRM} = sub { die "got timeout\n"; };
|
local $SIG{ALRM} = sub { die "got timeout\n"; };
|
||||||
|
|
||||||
$oldtimeout = alarm($timeout);
|
$oldtimeout = alarm($timeout);
|
||||||
@ -5738,15 +5740,18 @@ sub restore_tar_archive {
|
|||||||
my $tmpfn = "$conffile.$$.tmp";
|
my $tmpfn = "$conffile.$$.tmp";
|
||||||
|
|
||||||
# disable interrupts (always do cleanups)
|
# disable interrupts (always do cleanups)
|
||||||
local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = sub {
|
local $SIG{INT} =
|
||||||
print STDERR "got interrupt - ignored\n";
|
local $SIG{TERM} =
|
||||||
};
|
local $SIG{QUIT} =
|
||||||
|
local $SIG{HUP} = sub { print STDERR "got interrupt - ignored\n"; };
|
||||||
|
|
||||||
eval {
|
eval {
|
||||||
# enable interrupts
|
# enable interrupts
|
||||||
local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
|
local $SIG{INT} =
|
||||||
die "interrupted by signal\n";
|
local $SIG{TERM} =
|
||||||
};
|
local $SIG{QUIT} =
|
||||||
|
local $SIG{HUP} =
|
||||||
|
local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
|
||||||
|
|
||||||
if ($archive eq '-') {
|
if ($archive eq '-') {
|
||||||
print "extracting archive from STDIN\n";
|
print "extracting archive from STDIN\n";
|
||||||
|
@ -82,9 +82,11 @@ sub do_import {
|
|||||||
|
|
||||||
eval {
|
eval {
|
||||||
# trap interrupts so we have a chance to clean up
|
# trap interrupts so we have a chance to clean up
|
||||||
local $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = $SIG{HUP} = $SIG{PIPE} = sub {
|
local $SIG{INT} =
|
||||||
die "interrupted by signal\n";
|
local $SIG{TERM} =
|
||||||
};
|
local $SIG{QUIT} =
|
||||||
|
local $SIG{HUP} =
|
||||||
|
local $SIG{PIPE} = sub { die "interrupted by signal\n"; };
|
||||||
PVE::Storage::activate_volumes($storecfg, [$dst_volid]);
|
PVE::Storage::activate_volumes($storecfg, [$dst_volid]);
|
||||||
run_command($convert_command);
|
run_command($convert_command);
|
||||||
PVE::Storage::deactivate_volumes($storecfg, [$dst_volid]);
|
PVE::Storage::deactivate_volumes($storecfg, [$dst_volid]);
|
||||||
|
Loading…
Reference in New Issue
Block a user