Skip to content

Commit

Permalink
Merge pull request docker#1989 from alexlarsson/setsid
Browse files Browse the repository at this point in the history
Container: Always create a new session for the container
  • Loading branch information
Victor Vieux committed Sep 25, 2013
2 parents c9b916b + c1c74cb commit 1363de0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 1363de0

Please sign in to comment.