Add parent death signal to the container config
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
8850636eb3
commit
58023ad32f
|
@ -21,6 +21,10 @@ type Config struct {
|
|||
// This is a common option when the container is running in ramdisk
|
||||
NoPivotRoot bool `json:"no_pivot_root,omitempty"`
|
||||
|
||||
// ParentDeathSignal specifies the signal that is sent to the container's process in the case
|
||||
// that the parent process dies.
|
||||
ParentDeathSignal int `json:"parent_death_signal,omitempty"`
|
||||
|
||||
// PivotDir allows a custom directory inside the container's root filesystem to be used as pivot, when NoPivotRoot is not set.
|
||||
// When a custom PivotDir not set, a temporary dir inside the root filesystem will be used. The pivot dir needs to be writeable.
|
||||
// This is required when using read only root filesystems. In these cases, a read/writeable path can be (bind) mounted somewhere inside the root filesystem to act as pivot.
|
||||
|
|
|
@ -117,8 +117,7 @@ func (c *linuxContainer) commandTemplate(process *Process) *exec.Cmd {
|
|||
if cmd.SysProcAttr == nil {
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||
}
|
||||
// TODO: add pdeath to config for a container
|
||||
cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL
|
||||
cmd.SysProcAttr.Pdeathsig = syscall.Signal(c.config.ParentDeathSignal)
|
||||
return cmd
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue