clair: catch both SIGINT and SIGTERM for graceful shutdown
This commit is contained in:
parent
09dda9bfd7
commit
19e9d1234e
3
clair.go
3
clair.go
@ -20,6 +20,7 @@ import (
|
|||||||
"math/rand"
|
"math/rand"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/coreos/clair/api"
|
"github.com/coreos/clair/api"
|
||||||
@ -62,7 +63,7 @@ func Boot(config *config.Config) {
|
|||||||
go updater.Run(config.Updater, db, st)
|
go updater.Run(config.Updater, db, st)
|
||||||
|
|
||||||
// Wait for interruption and shutdown gracefully.
|
// Wait for interruption and shutdown gracefully.
|
||||||
waitForSignals(os.Interrupt)
|
waitForSignals(syscall.SIGINT, syscall.SIGTERM)
|
||||||
log.Info("Received interruption, gracefully stopping ...")
|
log.Info("Received interruption, gracefully stopping ...")
|
||||||
st.Stop()
|
st.Stop()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user