Follow-up from "Kubernetes executor: prevent background processes from hanging the entire job"
The following discussion from !4162 (merged) should be addressed:
-
@charvie started a discussion: (+1 comment)
Hi @Snaipe @ratchade, running scripts in the background instead of the foreground is causing
SIGINTandSIGQUITto be ignored by default. This behavior is documented here.Non-builtin commands started by Bash have signal handlers set to the values inherited by the shell from its parent. When job control is not in effect, asynchronous commands ignore
SIGINTandSIGQUITin addition to these inherited handlers.Unfortunately, there is no way to restore the default signal handlers with
trap, as stated here.Signals ignored upon entry to the shell cannot be trapped or reset.
Any processes spawned as part of the script which previously relied upon the default signal handlers can, of course, restore them using
signal(2)orsigaction(2), but I can't imagine that being an acceptable side effect of this MR.