Closed mildred closed 7 years ago
Hi, yes, you already opened this issue once before for #14. I'll close for the same reason (see #14).
No, this is not the same, #14 was about ignoring SIGTERM, this one is about forwarding SIGTERM.
I used the same branch for both PR, but they are different. #14 is about ignoring SIGTERM (which was incorrect) and this PR is about forwarding SIGTERM.
Ah interesting, I didn't realize that SIGTERM isn't sent to all processes. That is interesting. I'll reopen this.
Hm, I can't reopen this PR for some reason. I'll take a look again.
SIGINT is generally sent to all processes connected to the virtual terminal when typing Ctrl-C. SIGTERM is generally sent to a single process. In that case, it is wise not to ignore that signal but to forward it to the child process instead to give it the opportunity to handle it.
This is required for correct handling of SIGTERM inside terraform, see hashicorp/terraform#10459. When SIGTERN is sent to the parent process, ignoring the signal won't help, it must be forwarded.
This PR contains a default that depends on the platform for the list of forwarded signals. On UNIX it contains SIGTERM and on Windows, nothing. Possibly the default could be no signal at all by default, and let the panicwrap user choose on its own.