From 58c06a4f2673511a0643a6de8ce50dc827aa43d7 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 24 Sep 2013 14:57:29 +0200 Subject: [PATCH] Container: Always create a new session for the container We never want the container to be in the same process group as the daemon, as then the container will receive signals sent to the process group of the container. Upstream-commit: c1c74cb0b1e83c4836b51828888daff181f52742 Component: engine --- components/engine/container.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/engine/container.go b/components/engine/container.go index 6bca3dfbf2..2616fb221f 100644 --- a/components/engine/container.go +++ b/components/engine/container.go @@ -393,7 +393,7 @@ func (container *Container) startPty() error { // stdin if container.Config.OpenStdin { container.cmd.Stdin = ptySlave - container.cmd.SysProcAttr = &syscall.SysProcAttr{Setctty: true, Setsid: true} + container.cmd.SysProcAttr.Setctty = true go func() { defer container.stdin.Close() utils.Debugf("[startPty] Begin of stdin pipe") @@ -800,6 +800,8 @@ func (container *Container) Start(hostConfig *HostConfig) error { return err } + container.cmd.SysProcAttr = &syscall.SysProcAttr{Setsid: true} + var err error if container.Config.Tty { err = container.startPty()