mirror of
https://github.com/opencontainers/runc.git
synced 2025-10-17 13:00:45 +08:00
Add parent death signal to the container config
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
@@ -21,6 +21,10 @@ type Config struct {
|
|||||||
// This is a common option when the container is running in ramdisk
|
// This is a common option when the container is running in ramdisk
|
||||||
NoPivotRoot bool `json:"no_pivot_root,omitempty"`
|
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.
|
// 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.
|
// 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.
|
// 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 {
|
if cmd.SysProcAttr == nil {
|
||||||
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
cmd.SysProcAttr = &syscall.SysProcAttr{}
|
||||||
}
|
}
|
||||||
// TODO: add pdeath to config for a container
|
cmd.SysProcAttr.Pdeathsig = syscall.Signal(c.config.ParentDeathSignal)
|
||||||
cmd.SysProcAttr.Pdeathsig = syscall.SIGKILL
|
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user