krallin/tini

prctl(PR_SET_PDEATHSIG, ...) should be called after fork(), not before

igor-anferov opened this issue · 4 comments

From the official Linux documentation:

The parent-death signal setting is cleared for the child of a fork(2).

So, calling prctl(PR_SET_PDEATHSIG, ...) before spawn(), which is currently the case, doesn't make sense.

Aaah, I see, thanks for your explanation. But I still don't understand the last phrase from the commit message:

    $ unshare --pid --fork setpriv --reuid user tini -s -p SIGKILL -- <prog>

As soon as unshare is getting killed, tini will get signalled SIGKILL
and exit as well, tearing down <prog> with it.

Why would be torn down in this case?

Got it, thank you!