New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce docker exec kill #35703
Comments
I'd like to take this issue and will send a pull request. |
Hello, I would like to ask if this issue includes my current issue (and if the proposed implementation takes care of it): When I add another process with # Shell 1: Run a long-running process in a container
docker run --rm -t --name exec_signal_problem python:3 sleep 999
# Shell 2: Run another process that I would like to run for a while but be able to stop it cleanly
# Here I run a Python interpreter that will catch SIGTERM signals printing them
docker exec exec_signal_problem python -c "import signal;signal.signal(signal.SIGTERM, print);import time; time.sleep(600)"
# Shell 3: kill the docker exec process
ps aux | grep "docker exec exec_signal_problem" | grep -v grep | awk '{print $2}' | xargs kill -s SIGTERM My expected behavior and output would be that Shell 2 would print the SIGTERM signal received, such as: 15 <frame object at 0x7f2c84765050> But instead, the process in Shell 2 is killed with SIGKILL and I get the output: Terminated Note that the process has been effectively killed (I've read other issues while googling what is going on of people finding their processes still running). In case it matters, my use-case includes having one docker container running (with a main command, usually a driver for a device) and running multiple commands via Also thanks a lot for your great work. Edit: My Client: Docker Engine - Community
Version: 19.03.13
API version: 1.40
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:02:36 2020
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 19.03.13
API version: 1.40 (minimum version 1.12)
Go version: go1.13.15
Git commit: 4484c46d9d
Built: Wed Sep 16 17:01:06 2020
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.3.7
GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175
runc:
Version: 1.0.0-rc10
GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd
docker-init:
Version: 0.18.0
GitCommit: fec3683 |
Adding here a comment to link to the workaround I made in order to support killing a command that was docker exec-ed: #9098 (comment) |
Description
One can start additional processes in a container with
exec
API, one can inspect their status using exec/{id}/json, but one can't kill such a process.I suggest an API is introduced for this purpose, /exec/{id}/stop + /exec/{id}/kill to mimic the equivalent for container's PID 1.
The text was updated successfully, but these errors were encountered: