diff --git a/process.go b/process.go index 3f62f39..d7802f6 100644 --- a/process.go +++ b/process.go @@ -6,10 +6,11 @@ import ( "syscall" ) -// OnInterruptSignal invokes fn when SIGNINT/SIGTERM is received. +// OnInterruptSignal invokes fn when an interrupt signal is received. +// We loosely define the interrupt signal as SIGINT, SIGTERM, and SIGHUP. func onInterruptSignal(fn func()) { signalChan := make(chan os.Signal, 1) - signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM) + signal.Notify(signalChan, syscall.SIGINT, syscall.SIGTERM, syscall.SIGHUP) go func() { <-signalChan fn()