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

Dpw kill process group #16

Merged
merged 2 commits into from
Oct 27, 2015
Merged

Dpw kill process group #16

merged 2 commits into from
Oct 27, 2015

Conversation

krallin
Copy link
Owner

@krallin krallin commented Oct 26, 2015

For CI - #15 + tests

dpw and others added 2 commits October 26, 2015 21:52
tini only kills the immediate child process.  This means that if you
do, for example,

    docker run krallin/ubuntu-tini sh -c 'sleep 10'

and ctrl-C it, nothing happens: SIGINT is sent to the 'sh' process,
but that shell won't react to it while it is waiting for the 'sleep'
to finish.

This change adds a -g option to put the child process of tini into a
new process group, and sends signals to that group, so that every
process in the group gets a signal.  This corresponds more closely to
what happens when you do ctrl-C etc. in a terminal: The signal is sent
to the foreground process group.

So if you try the example above with a container image that passes -g
to tini, the SIGINT will be received by the 'sleep', and the container
promptly exits.
@krallin krallin force-pushed the dpw-kill-process-group branch from 8b09245 to e7bae98 Compare October 26, 2015 20:56
krallin added a commit that referenced this pull request Oct 27, 2015
Support for kill process group, thanks @dpw!
@krallin krallin merged commit cf1cb5c into master Oct 27, 2015
@krallin krallin deleted the dpw-kill-process-group branch October 27, 2015 18:51
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 this pull request may close these issues.

2 participants