diff --git a/cmd/restic/cleanup.go b/cmd/restic/cleanup.go index 75933fe96..d1c8ecc1a 100644 --- a/cmd/restic/cleanup.go +++ b/cmd/restic/cleanup.go @@ -19,7 +19,7 @@ var cleanupHandlers struct { func init() { cleanupHandlers.ch = make(chan os.Signal, 1) go CleanupHandler(cleanupHandlers.ch) - signal.Notify(cleanupHandlers.ch, syscall.SIGINT) + signal.Notify(cleanupHandlers.ch, syscall.SIGINT, syscall.SIGTERM) } // AddCleanupHandler adds the function f to the list of cleanup handlers so @@ -70,7 +70,7 @@ func CleanupHandler(c <-chan os.Signal) { code := 0 - if s == syscall.SIGINT { + if s == syscall.SIGINT || s == syscall.SIGTERM { code = 130 } else { code = 1