mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-02 01:18:26 +03:00
Block SIGINT & SIGTERM in clvmd subthreads so they don't delay shutdown.
Patch from Xinwei Hu, Thanks
This commit is contained in:
parent
fbd97a3425
commit
c35df82da9
@ -1,5 +1,6 @@
|
|||||||
Version 2.02.46 -
|
Version 2.02.46 -
|
||||||
================================
|
================================
|
||||||
|
Block SIGTERM & SIGINT in clvmd subthreads.
|
||||||
Detect and conditionally wipe swapspace signatures in pvcreate.
|
Detect and conditionally wipe swapspace signatures in pvcreate.
|
||||||
Fix maximal volume count check for snapshots if max_lv set for volume group.
|
Fix maximal volume count check for snapshots if max_lv set for volume group.
|
||||||
Fix lvcreate to remove cow volume if the snapshot creation fails.
|
Fix lvcreate to remove cow volume if the snapshot creation fails.
|
||||||
|
@ -372,9 +372,11 @@ int main(int argc, char *argv[])
|
|||||||
signal(SIGHUP, sighup_handler);
|
signal(SIGHUP, sighup_handler);
|
||||||
signal(SIGPIPE, SIG_IGN);
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
/* Block SIGUSR2 in the main process */
|
/* Block SIGUSR2/SIGINT/SIGTERM in process */
|
||||||
sigemptyset(&ss);
|
sigemptyset(&ss);
|
||||||
sigaddset(&ss, SIGUSR2);
|
sigaddset(&ss, SIGUSR2);
|
||||||
|
sigaddset(&ss, SIGINT);
|
||||||
|
sigaddset(&ss, SIGTERM);
|
||||||
sigprocmask(SIG_BLOCK, &ss, NULL);
|
sigprocmask(SIG_BLOCK, &ss, NULL);
|
||||||
|
|
||||||
/* Initialise the LVM thread variables */
|
/* Initialise the LVM thread variables */
|
||||||
@ -669,6 +671,11 @@ static void main_loop(int local_sock, int cmd_timeout)
|
|||||||
{
|
{
|
||||||
DEBUGLOG("Using timeout of %d seconds\n", cmd_timeout);
|
DEBUGLOG("Using timeout of %d seconds\n", cmd_timeout);
|
||||||
|
|
||||||
|
sigset_t ss;
|
||||||
|
sigemptyset(&ss);
|
||||||
|
sigaddset(&ss, SIGINT);
|
||||||
|
sigaddset(&ss, SIGTERM);
|
||||||
|
pthread_sigmask(SIG_UNBLOCK, &ss, NULL);
|
||||||
/* Main loop */
|
/* Main loop */
|
||||||
while (!quit) {
|
while (!quit) {
|
||||||
fd_set in;
|
fd_set in;
|
||||||
|
Loading…
Reference in New Issue
Block a user