From 19e9d1234ee2f001c01b688fd9dde84498b23df3 Mon Sep 17 00:00:00 2001 From: Quentin Machu Date: Mon, 7 Mar 2016 16:38:10 -0500 Subject: [PATCH] clair: catch both SIGINT and SIGTERM for graceful shutdown --- clair.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clair.go b/clair.go index a445f797..cfb5c850 100644 --- a/clair.go +++ b/clair.go @@ -20,6 +20,7 @@ import ( "math/rand" "os" "os/signal" + "syscall" "time" "github.com/coreos/clair/api" @@ -62,7 +63,7 @@ func Boot(config *config.Config) { go updater.Run(config.Updater, db, st) // Wait for interruption and shutdown gracefully. - waitForSignals(os.Interrupt) + waitForSignals(syscall.SIGINT, syscall.SIGTERM) log.Info("Received interruption, gracefully stopping ...") st.Stop() }