-
Notifications
You must be signed in to change notification settings - Fork 34
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
Fix ^C handling #178
Comments
As reported by @raharper and I, if you ctrl-c while stacker is running and has launched a container, it crashes gnu screen and all gnu screen processes. Yikes. |
That almost seems like a gnu screen bug? in tmux it just orphans the thing and dooesn't actually ^C :) |
weird. as a data point, I use gnu screen all the time and am pretty sure I've ^C'd a stacker build a few times. |
as of 5ffa9bd ("Reexec stacker build/recursive-build inside a user namespace") we have a wrapper process that is the one that actually receives the signal from the shell, and promptly ignores it. let's forward relevant signals to the child process... perhaps we should commonize this somehow with the stuff that's in container.go, but this is good enough for now. it would also be good to figure out how to test some of this, but i played around with bats, and various incantations of subshell job forking didn't work for me. e.g.: ~/packages/stacker fix-ctrlc cat test/ctrlc.bats load helpers function setup() { stacker_setup } function teardown() { cleanup } @test "stacker responds to SIGTERM" { cat > stacker.yaml <<EOF test: from: type: oci url: $CENTOS_OCI run: | sleep 100s EOF (stacker build) & pid=$! # let it get some progress; maybe this is still in go code, mabye it's in # the container's sleep, but it's somewhere interesting at least sleep 5s kill -SIGINT $pid wait $pid } and this at least fixes the problem, so let's just add it. Closes project-stacker#178 Signed-off-by: Tycho Andersen <[email protected]>
I don't think (?) this is fixed. It's "better" now, but I've still seen stacker kill tmux sessions. |
i dont think fixed either. :-(. its hard to remember to not hit ctrl-c if stacker is running. |
Yeah, any sleuthing about what's going on is much appreciated. I don't really understand what's happening here. |
Our outer userns exec wrapper doesn't forward ^C to the inner one, so things don't correctly get killed on ^C. We need to do something like what's in container.go:Execute() i guess.
The text was updated successfully, but these errors were encountered: