mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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.
This commit is contained in:
parent
d6887b769c
commit
c1c74cb0b1
1 changed files with 3 additions and 1 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue