]> git.proxmox.com Git - pve-common.git/commit
run_fork_with_timeout: do not overwrite global signal handlers
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 6 Sep 2017 11:29:03 +0000 (13:29 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 7 Sep 2017 08:27:29 +0000 (10:27 +0200)
commiteead1ccaa509e8559e466ca5926c6625f27bff35
tree75b9729ee7058fc131b5f48bbe23ce62e059d12c
parentcea9c7b4302a6ee8c2bb6d212204086efda6b4f2
run_fork_with_timeout: 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.

As we only send SIGINT to processes if a manual stop action gets
triggered just catch this one here.

As this is a general method which allows to pass an arbitrary code
payload we cannot sanely handle all signals here, so remove trapping
all other besides SIGINT, if those need to be trapped that should be
done by the caller on a case by case basis.

Fixes: #1495
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/PVE/Tools.pm