[pve-devel] applied: [PATCH qemu-server 4/5] API/clone: do not overwrite global signal handlers

Wolfgang Bumiller w.bumiller at proxmox.com
Thu Sep 7 10:43:49 CEST 2017


applied to master & stable-4

On Wed, Sep 06, 2017 at 01:29:06PM +0200, Thomas Lamprecht wrote:
> 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 at proxmox.com>
> ---
>  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 aa7c832..55957f7 100644
> --- a/PVE/API2/Qemu.pm
> +++ b/PVE/API2/Qemu.pm
> @@ -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);
>  
> -- 
> 2.11.0




More information about the pve-devel mailing list