pablo-ruth / go-init

A minimal init system for containers with pre/post hooks
MIT License
45 stars 18 forks source link

Request: supress SIGTERM and SIGINT signals #1

Closed kroozo closed 4 years ago

kroozo commented 5 years ago

Hi,

If I understand correctly (I am illiterate in go :) ) you are now exiting with an error if anything "bad" happens with the child commands. But this means that when you trigger a shutdown from outside, which is in a form of SIGTERM or SIGINT go-init exits with an error.

This is unfortunate, because some child processes might not suppress the signal which floats up to docker, and it shouldn't, because the container exited because I asked it to do so.

My actual use-case is that I am running tests with docker-compose. There is a bunch of services in it, and one of them is actually executing the tests on the others. I am using --abort-on-container-exit and --exit-code-from . This terminates all containers if one stops (which the test runner does, once it finishes). This unfortunately is sometimes not enough: if a service fails to start up correctly the testrunner might return 0, and I think all is green. I therefore want to inspect all exit codes, but some services that run go-init unfortunately pass over the sigterm signal, and I get an exit code 1 always. I'd rather get a 0 :)

Also, it probably would be good to pass on the error code from the child instead of a hardcoded 1.

thanks!

pablo-ruth commented 4 years ago

Hi, I'm sorry, as mentioned in the Readme, I don't maintain this project anymore. Please feel free to fork!