-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add ability to kill subprocess when parent process exits #10
Comments
Please complete the whole issue template, without deleting any headings. |
Yeah this bot is wrong, I definitely filled out the entire ticket. I've updated |
May be worth looking into Github Forms. Example here (click any of the |
Thanks for the interest @josegonzalez and you're right, Derek is misconfigured on this repo and I've removed that label, however the so called "legacy" templates are required for reasons. Are you handling signals when the process quits? Like here Killing your container's PID1 should also kill any other child processes. Adding a context to the command's execution may allow for it be cancelled later. Alex |
A recent issue (alexellis/go-execute#10) indirectly highlighted that the merging of local and remote configs was producing a superset which included duplicate headings. The intended mode of operation for the Issue template headings was for the local to over-ride the remote. This is diffent to the other fields, such as maintainers. This change adds the test to highlight the issue and addresses the issue in MergeDerekRepoConfigs. Signed-off-by: Richard Gee <richard@technologee.co.uk>
Not sure how I'd handle signals when we don't have direct access to the underlying |
The
cmd
object is not exposed in any way, so there is no way to callcmd.Process.Kill()
out of band if the parent process exits early.Expected Behaviour
I expect to be able to kill the process, or at least have it automatically exit on it's own with a non-zero exit code.
Current Behaviour
The process is currently orphaned and continues running to completion.
Possible Solution
Not sure, maybe an option like
ListenToSignals
(defaultfalse
) that will listen to process signals and pass them along to the child. This would allow ctrl+c and the like to work properly (not sure aboutSIGKILL
though).Steps to Reproduce (for bugs)
Use the following in a bin and issue a ctrl+c on the executing terminal.
docker ps
should still show the container.Why do you need this?
I'm writing a tool that wraps
docker
calls - well, maybe now using the docker api if it seems straightforward enough - and was waiting a long time for a command to execute anything (because the underlying tool was slow). I ranctrl+c
and then noticed the container was still up.Your Environment
go version
: go version go1.17.9 darwin/amd64Operating System and version (e.g. Linux, Windows, MacOS): macOS Monterey 12.3.1
Link to your project or a code example to reproduce issue: The above code reproduces my issue (the project I'm working on isn't published yet).
The text was updated successfully, but these errors were encountered: