From ee295049231c84e59d00b7cf31eaefb86d936aad Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 18 Apr 2019 22:29:47 +0200 Subject: [PATCH] Do not disable sig-proxy when using a TTY This partially reverts https://github.com/moby/moby/commit/e0b59ab52b87b8fc15dd5534c3231fdd74843f9f, and does not automatically disable proxying signals in TTY-mode Before this change: ------------------------------------ Start a container with a TTY in one shell: ``` docker run -it --init --name repro-28872 busybox sleep 30 ``` then, in another shell, kill the docker cli: ``` kill `pgrep -f repro-28872` ``` Notice that the CLI was killed, but the signal not forwarded to the container; the container continues running ``` docker container inspect --format '{{ .State.Status }}' repro-28872 running docker container rm -f repro-28872 ``` After this change: ------------------------------------ Start a container with a TTY in one shell: ``` docker run -it --init --name repro-28872 busybox sleep 30 ``` then, in another shell, kill the docker cli: ``` kill `pgrep -f repro-28872` ``` Verify that the signal was forwarded to the container, and the container exited ``` docker container inspect --format '{{ .State.Status }}' repro-28872 exited docker container rm -f repro-28872 ``` Signed-off-by: Sebastiaan van Stijn --- cli/command/container/run.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cli/command/container/run.go b/cli/command/container/run.go index 93f84a711a..c7f51f3dcc 100644 --- a/cli/command/container/run.go +++ b/cli/command/container/run.go @@ -117,11 +117,6 @@ func runContainer(dockerCli command.Cli, opts *runOptions, copts *containerOptio config.StdinOnce = false } - // Disable sigProxy when in TTY mode - if config.Tty { - opts.sigProxy = false - } - // Telling the Windows daemon the initial size of the tty during start makes // a far better user experience rather than relying on subsequent resizes // to cause things to catch up.