Skip to content

Commit

Permalink
clair: catch both SIGINT and SIGTERM for graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin-M committed Mar 7, 2016
1 parent 09dda9b commit 19e9d12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clair.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"math/rand"
"os"
"os/signal"
"syscall"
"time"

"github.com/coreos/clair/api"
Expand Down Expand Up @@ -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()
}
Expand Down

0 comments on commit 19e9d12

Please sign in to comment.