Skip to content
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

Foreground containers should die gracefully when sent a kill signal #507

Closed
gabrtv opened this issue May 3, 2013 · 7 comments · Fixed by #1249
Closed

Foreground containers should die gracefully when sent a kill signal #507

gabrtv opened this issue May 3, 2013 · 7 comments · Fixed by #1249

Comments

@gabrtv
Copy link

gabrtv commented May 3, 2013

Issuing a CTRL-C (SIGINT) on a container running in the foreground doesn't kill it. This makes docker difficult to daemonize with utilities like upstart and supervisord.

# docker run lucid64-base sleep 60
^C
# docker ps
ID             IMAGE                 COMMAND     CREATED         STATUS         COMMENT     PORTS
b062d84ccae1   lucid64-base:latest   sleep 60    4 seconds ago   Up 4 seconds

Discussed with @shykes on IRC:

gabrtv
8:44 shykes: do you see an issue with foreground containers trapping SIGINT/SIGTERM and terminating gracefully? if not, i'd be willing to take a crack at it

shykes
8:44 gabrtv: no design issues per-se, just needs to be implemented
8:45 there are 2 ways: 1) intercept signals in the client, and translate them to 'docker kill' calls (easier) 2) bring back standalone mode (harder)

@adamjt
Copy link

adamjt commented May 15, 2013

+1 Would love to have this for easy interaction with Upstart.

@bfulton
Copy link

bfulton commented May 15, 2013

+1 for this, would also like to see support (ala #415) to control the SIGTERM ... SIGKILL interval.

@gabrtv
Copy link
Author

gabrtv commented May 15, 2013

I took a crack at implementing this, but failed quickly after getting lost in how rcli works. From what I could tell, we need the CLI to intercept the signal and then somehow forward a docker kill to the daemon.

I was planning on letting the remote API (#21) evolve a bit, then try again using that.

@patrickod
Copy link

Another +1 for this. I'd love to be able to configure containers to run on boot with upstart similar to the way I'm sure @adamjt is looking to use it. At the moment this doesn't seem very doable.

@rca
Copy link

rca commented Jul 19, 2013

+1 I am also looking to manage containers with upstart and/or supervisor. Thanks!

@warpfork
Copy link
Contributor

@unclejack's work in https://github.com/unclejack/dockrun builds this kind of signal handling over docker.

@unclejack
Copy link
Contributor

This functionality is going to be merged into docker, along with other needed features.
I'll be sending a PR for this feature soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants