{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/28872","repository_url":"https://api.github.com/repos/docker/docker","labels_url":"https://api.github.com/repos/docker/docker/issues/28872/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/28872/comments","events_url":"https://api.github.com/repos/docker/docker/issues/28872/events","html_url":"https://github.com/docker/docker/issues/28872","id":191936985,"number":28872,"title":"docker client doesn't pass signals when a terminal is attached","user":{"login":"jarro2783","id":1456242,"avatar_url":"https://avatars.githubusercontent.com/u/1456242?v=3","gravatar_id":"","url":"https://api.github.com/users/jarro2783","html_url":"https://github.com/jarro2783","followers_url":"https://api.github.com/users/jarro2783/followers","following_url":"https://api.github.com/users/jarro2783/following{/other_user}","gists_url":"https://api.github.com/users/jarro2783/gists{/gist_id}","starred_url":"https://api.github.com/users/jarro2783/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarro2783/subscriptions","organizations_url":"https://api.github.com/users/jarro2783/orgs","repos_url":"https://api.github.com/users/jarro2783/repos","events_url":"https://api.github.com/users/jarro2783/events{/privacy}","received_events_url":"https://api.github.com/users/jarro2783/received_events","type":"User","site_admin":false},"labels":[{"id":73641990,"url":"https://api.github.com/repos/docker/docker/labels/area/runtime","name":"area/runtime","color":"fbca04","default":false},{"id":375217742,"url":"https://api.github.com/repos/docker/docker/labels/version/1.11","name":"version/1.11","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-28T07:33:59Z","updated_at":"2016-12-26T00:46:35Z","closed_at":null,"body":"**Description**\r\n\r\nRe #3793: when running with `-ti`, `docker run` does not pass signals to child process.\r\n\r\n**Steps to reproduce the issue:**\r\n1. I built an image `FROM base/archlinux`, with https://github.com/krallin/tini in it.\r\n2. `docker run -ti tini-arch /tini -- sleep 300`\r\n3. `ps -A f | grep docker`\r\n\r\n        31807 pts/5    Sl+    0:00              |   |   |   \\_ docker run -ti tini-arch /tini -- sleep 300\r\n\r\n4. `kill 31807`\r\n\r\n**Describe the results you received:**\r\n\r\nIn the terminal window attached I see\r\n\r\n    Terminated\r\n\r\nIn another window:\r\n```\r\ndocker ps\r\nCONTAINER ID        IMAGE               COMMAND                CREATED             STATUS              PORTS               NAMES\r\n94e81d8dd7db        tini-arch           \"/tini -- sleep 300\"   59 seconds ago      Up 58 seconds                           angry_ardinghelli\r\n```\r\n\r\n**Describe the results you expected:**\r\n\r\nI expect the container to stop running because it has been passed the appropriate signal. I have confirmed that running the same without `-ti` prints nothing in the attached terminal, and `docker ps` shows that the running container has stopped.\r\n\r\nThis is necessary because I expect that in situations like running a container over an SSH session should terminate the container if the SSH session hangs up, because SIGHUP will be sent to the client when the terminal closes.\r\n\r\n**Output of `docker version`:**\r\n\r\n```\r\nClient:\r\n Version:      1.11.0\r\n API version:  1.23\r\n Go version:   go1.6.1\r\n Git commit:   4dc5990\r\n Built:        \r\n OS/Arch:      linux/amd64\r\n\r\nServer:\r\n Version:      1.11.0\r\n API version:  1.23\r\n Go version:   go1.6.1\r\n Git commit:   4dc5990\r\n Built:        \r\n OS/Arch:      linux/amd64\r\n```\r\n\r\n**Output of `docker info`:**\r\n\r\n```\r\nContainers: 19\r\n Running: 0\r\n Paused: 0\r\n Stopped: 19\r\nImages: 206\r\nServer Version: 1.11.0\r\nStorage Driver: overlay\r\n Backing Filesystem: extfs\r\nLogging Driver: json-file\r\nCgroup Driver: cgroupfs\r\nPlugins: \r\n Volume: local\r\n Network: bridge null host\r\nKernel Version: 4.4.6-gentoo\r\nOperating System: Gentoo/Linux\r\nOSType: linux\r\nArchitecture: x86_64\r\nCPUs: 2\r\nTotal Memory: 3.829 GiB\r\nName: guepardo\r\nID: Y6HO:RPCY:TMYW:63IN:CQP2:I4JY:6EUL:AYHK:HBH2:JK7U:YCYJ:ODTY\r\nDocker Root Dir: /var/lib/docker\r\nDebug mode (client): false\r\nDebug mode (server): false\r\nUsername: jarro2783\r\nRegistry: https://index.docker.io/v1/\r\nWARNING: No cpu cfs quota support\r\nWARNING: No cpu cfs period support\r\n```\r\n\r\n**Additional environment details (AWS, VirtualBox, physical, etc.):**\r\n\r\nPhysical machine. I have confirmed this on another physical host running 1.12.0."},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/269144027","html_url":"https://github.com/docker/docker/issues/28872#issuecomment-269144027","issue_url":"https://api.github.com/repos/docker/docker/issues/28872","id":269144027,"user":{"login":"jarro2783","id":1456242,"avatar_url":"https://avatars.githubusercontent.com/u/1456242?v=3","gravatar_id":"","url":"https://api.github.com/users/jarro2783","html_url":"https://github.com/jarro2783","followers_url":"https://api.github.com/users/jarro2783/followers","following_url":"https://api.github.com/users/jarro2783/following{/other_user}","gists_url":"https://api.github.com/users/jarro2783/gists{/gist_id}","starred_url":"https://api.github.com/users/jarro2783/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jarro2783/subscriptions","organizations_url":"https://api.github.com/users/jarro2783/orgs","repos_url":"https://api.github.com/users/jarro2783/repos","events_url":"https://api.github.com/users/jarro2783/events{/privacy}","received_events_url":"https://api.github.com/users/jarro2783/received_events","type":"User","site_admin":false},"created_at":"2016-12-26T00:46:35Z","updated_at":"2016-12-26T00:46:35Z","body":"That's a bit curious then. [Two comments later](https://github.com/docker/docker/pull/2426#issuecomment-27324597) seems to indicate that it doesn't work very well though.\r\n\r\nI just thought I would add too that this seems to work fine when a TTY is not enabled, so none of the issues in #3793 are the problem here.\r\n\r\nThese are the processes *inside* the container, so `tini` will pass signals as expected:\r\n```\r\n14707 pts/18   Ss     0:00          \\_ /tini sleep 400\r\n14719 pts/18   S+     0:00              \\_ sleep 400\r\n```\r\n\r\nThen the client is this:\r\n```\r\n15403 pts/16   Sl+    0:00              \\_ docker run -ti tini-arch /tini sleep 400\r\n```\r\nwhich when killed leaves the container running, if it was started with a terminal. "}}
{"actor":{"display_login":"jarro2783"}}