mirror of
https://github.com/troglobit/finit.git
synced 2026-11-10 16:31:21 +00:00
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.
This commit is contained in:
1 parent
c0af01db6d
commit
a3193b34a6
2 files changed
+3
No files matched your search
@@ -278,6 +278,8 @@ int service_start(svc_t *svc)
|
|||||||
_e("%starting %s: %s", respawn ? "Res" : "S", svc->cmd, buf);
|
_e("%starting %s: %s", respawn ? "Res" : "S", svc->cmd, buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sig_unblock();
|
||||||
|
|
||||||
if (svc->inetd.cmd)
|
if (svc->inetd.cmd)
|
||||||
status = svc->inetd.cmd(svc->inetd.type);
|
status = svc->inetd.cmd(svc->inetd.type);
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -188,6 +188,7 @@ void sig_unblock(void)
|
|||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
|
|
||||||
sigemptyset(&nmask);
|
sigemptyset(&nmask);
|
||||||
|
sigaddset(&nmask, SIGHUP);
|
||||||
sigaddset(&nmask, SIGCHLD);
|
sigaddset(&nmask, SIGCHLD);
|
||||||
sigaddset(&nmask, SIGINT);
|
sigaddset(&nmask, SIGINT);
|
||||||
sigaddset(&nmask, SIGPWR);
|
sigaddset(&nmask, SIGPWR);
|
||||||
|
|||||||
Reference in new issue
Block a user