osutil: force SIG_DFL before resending terminating signal

The go runtime won't always reinstall the default signal handler on the
SIGTERM path, so it's possible the signal won't terminate the process.
Instead, force SIG_DFL for the signal.
This commit is contained in:
Anthony Romano
2017-05-09 15:20:21 -07:00
parent 90893735cf
commit 7a1739a3e8
5 changed files with 55 additions and 0 deletions

View File

@ -68,6 +68,7 @@ func HandleInterrupts() {
if pid == 1 {
os.Exit(0)
}
setDflSignal(sig.(syscall.Signal))
syscall.Kill(pid, sig.(syscall.Signal))
}()
}