controller: exit cleanly on SIGTERM

This signal may be sent using an external tool such as pkill, and since
we can handle it neatly, we should.

Signed-off-by: Justin Chadwell <me@jedevc.com>
pull/1620/head
Justin Chadwell 2 years ago
parent 1b91bc2e02
commit abda257763

@ -154,7 +154,8 @@ func serveCmd(dockerCli command.Cli) *cobra.Command {
var s os.Signal
sigCh := make(chan os.Signal, 1)
signal.Notify(sigCh, os.Interrupt)
signal.Notify(sigCh, syscall.SIGINT)
signal.Notify(sigCh, syscall.SIGTERM)
select {
case err := <-errCh:
logrus.Errorf("got error %s, exiting", err)

Loading…
Cancel
Save