dotcloud/docker — pull request #5792 by bernerdschaefer (2014-05-14 09:58:32+00:00)
Title: Add PDEATHSIG support to nsinit library

When using the "nsinit" executable, I expect the container process to die if the "nsinit exec" process unexpectedly dies.

This can partly be addressed by setting `Pdeathsig` in the init command's `SysProcAttr`. However, pdeathsig is reset after calls to setgid/setuid (e.g., when container.User is set). So for full support of parent death signals, the "init" process needs to know how to restore the signal.

I've broken this into three logical commits:

1. Add `GetParentDeathSignal` to "pkg/system"
2. Add `RestoreParentDeathSignal` to nsinit, called after finalizing the namespace (when user/group changes happen).
3. `DefaultCreateCommand` sets the parent death signal to SIGKILL.