diff --git a/daemon/wait.go b/daemon/wait.go index 641dfaa..83d3001 100644 --- a/daemon/wait.go +++ b/daemon/wait.go @@ -15,16 +15,19 @@ var ( ) // WaitForSignal waits until one of the specified signals are received. -func WaitForSignal(sig ...os.Signal) { +func WaitForSignal(sig ...os.Signal) os.Signal { ch := make(chan os.Signal, 1) signal.Notify(ch, sig...) s := <-ch + log.Debug(). Str("signal", s.String()). Msg("Signal caught") + + return s } -// WaitForDefaultSignals waits until one of SIGINT, SIGQUIT or SIGTERM is received. -func WaitForDefaultSignals() { +// WaitForSignalsDefault waits until one of SIGINT, SIGQUIT or SIGTERM is received. +func WaitForSignalsDefault() { WaitForSignal(Interrupt, Quit, Terminate) }