summaryrefslogtreecommitdiff
path: root/cmd/rr
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/rr')
-rw-r--r--cmd/rr/cmd/serve.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/rr/cmd/serve.go b/cmd/rr/cmd/serve.go
index 8028395a..31dd6039 100644
--- a/cmd/rr/cmd/serve.go
+++ b/cmd/rr/cmd/serve.go
@@ -36,14 +36,21 @@ func init() {
Run: serveHandler,
})
- signal.Notify(stopSignal, os.Interrupt, os.Kill, syscall.SIGTERM)
+ signal.Notify(stopSignal, os.Interrupt, os.Kill, syscall.SIGTERM, syscall.SIGINT)
}
func serveHandler(cmd *cobra.Command, args []string) {
+ stopped := make(chan interface{})
+
go func() {
<-stopSignal
Container.Stop()
+ close(stopped)
}()
- Container.Serve()
+ if err := Container.Serve(); err != nil {
+ return
+ }
+
+ <-stopped
}