Skip to content

Commit

Permalink
Explicitly unblock SIGTERM
Browse files Browse the repository at this point in the history
On my CentOS 7 box, when started using "init=/sbin/bootchartd",
bootchart-collector has SIGTERM blocked, preventing
"bootchartd stop" from working.
  • Loading branch information
mephi42 committed Feb 2, 2016
1 parent c39e34e commit a166537
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions collector/collector.c
Expand Up @@ -731,16 +731,21 @@ term_handler (int sig)
}

static void
setup_sigaction(int sig)
setup_sigaction (int sig)
{
sigset_t unblock_mask;
struct sigaction sa;
sigset_t block_mask;

sigemptyset(&block_mask);
sigemptyset (&unblock_mask);
sigaddset (&unblock_mask, sig);
sigprocmask (SIG_UNBLOCK, &unblock_mask, NULL);

sigemptyset (&block_mask);
sa.sa_handler = term_handler;
sa.sa_mask = block_mask;
sa.sa_flags = 0;
sigaction(sig, &sa, NULL);
sigaction (sig, &sa, NULL);
}

static void
Expand Down

0 comments on commit a166537

Please sign in to comment.