Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd: forward signals through userns wrapper
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 #178 Signed-off-by: Tycho Andersen <[email protected]>
- Loading branch information