From a3193b34a6d96a44596d1a21be46348706ba1fa4 Mon Sep 17 00:00:00 2001 From: Tobias Waldekranz Date: Fri, 16 Oct 2015 18:32:53 +0200 Subject: [PATCH] Unblock blocked signals after forking off a child After forking off a new child, all signals that are blocked by finit should be unblocked before exec-ing the final binary. Also, finit now blocks SIGHUP, so add it to the set of signals that should be unblocked. --- service.c | 2 ++ sig.c | 1 + 2 files changed, 3 insertions(+) diff --git a/service.c b/service.c index ce09b527..354b4716 100644 --- a/service.c +++ b/service.c @@ -278,6 +278,8 @@ int service_start(svc_t *svc) _e("%starting %s: %s", respawn ? "Res" : "S", svc->cmd, buf); } + sig_unblock(); + if (svc->inetd.cmd) status = svc->inetd.cmd(svc->inetd.type); else diff --git a/sig.c b/sig.c index aba9cf0e..e0b6d4e5 100644 --- a/sig.c +++ b/sig.c @@ -188,6 +188,7 @@ void sig_unblock(void) struct sigaction sa; sigemptyset(&nmask); + sigaddset(&nmask, SIGHUP); sigaddset(&nmask, SIGCHLD); sigaddset(&nmask, SIGINT); sigaddset(&nmask, SIGPWR);