diff options
Diffstat (limited to 'container/container.go')
| -rw-r--r-- | container/container.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/container/container.go b/container/container.go index 09360df5..7f2d9b97 100644 --- a/container/container.go +++ b/container/container.go @@ -68,6 +68,8 @@ type ( Args []string // Deliver SIGINT to the initial process on context cancellation. ForwardCancel bool + // time to wait for linger processes after death of initial process + AdoptWaitDelay time.Duration // Mapped Uid in user namespace. Uid int @@ -128,6 +130,14 @@ func (p *Container) Start() error { p.SeccompPresets |= seccomp.PresetDenyTTY } + if p.AdoptWaitDelay == 0 { + p.AdoptWaitDelay = 5 * time.Second + } + // to allow disabling this behaviour + if p.AdoptWaitDelay < 0 { + p.AdoptWaitDelay = 0 + } + p.cmd = exec.CommandContext(ctx, MustExecutable()) p.cmd.Args = []string{initName} p.cmd.Stdin, p.cmd.Stdout, p.cmd.Stderr = p.Stdin, p.Stdout, p.Stderr |
