From: Robert Swiecki Date: Wed, 14 Jun 2017 00:19:03 +0000 (+0200) Subject: Me mode: make init reap zombie processes X-Git-Tag: 1.5~61 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b67ea2272f1985f77ba446808e0b46edfb12d23d;p=platform%2Fupstream%2Fnsjail.git Me mode: make init reap zombie processes --- diff --git a/pid.c b/pid.c index 25694d6..d4186fe 100644 --- a/pid.c +++ b/pid.c @@ -47,9 +47,12 @@ bool pidInitNs(struct nsjconf_t *nsjconf) if (pid > 0) { return true; } - if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0, 0, 0) == -1) { + if (prctl(PR_SET_PDEATHSIG, SIGKILL, 0UL, 0UL, 0UL) == -1) { PLOG_W("(prctl(PR_SET_PDEATHSIG, SIGKILL) failed"); } + if (prctl(PR_SET_NAME, "init", 0UL, 0UL, 0UL) == -1) { + PLOG_W("(prctl(PR_SET_NAME, 'init') failed"); + } /* Act sort-a like a init by reaping zombie processes */ struct sigaction sa = { @@ -58,8 +61,8 @@ bool pidInitNs(struct nsjconf_t *nsjconf) .sa_restorer = NULL, }; sigemptyset(&sa.sa_mask); - if (sigaction(SIGSTOP, &sa, NULL) == -1) { - PLOG_W("Couldn't set sighandler for SIGSTOP"); + if (sigaction(SIGCHLD, &sa, NULL) == -1) { + PLOG_W("Couldn't set sighandler for SIGCHLD"); } for (;;) {