diff --git a/main.go b/main.go index e90b1ff..8887e10 100644 --- a/main.go +++ b/main.go @@ -112,7 +112,10 @@ func main() { go sigHandler() signal.Notify(sigChan, syscall.SIGUSR1, - syscall.SIGUSR2) + syscall.SIGUSR2, + syscall.SIGQUIT, + syscall.SIGTERM, + syscall.SIGINT) // Populate memory stats if Conf.Mem.Enabled { diff --git a/signal.go b/signal.go index 5a36527..ea94087 100644 --- a/signal.go +++ b/signal.go @@ -25,6 +25,9 @@ func sigHandler() { UpdateReady <- true + case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT: + os.Exit(0) + // We have signal that we're not interested in, so make a new loop iteration. default: continue