From abda257763a170c67c8f1f660a7c348af550eb47 Mon Sep 17 00:00:00 2001 From: Justin Chadwell Date: Fri, 10 Feb 2023 12:33:35 +0000 Subject: [PATCH] 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 --- controller/remote/controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controller/remote/controller.go b/controller/remote/controller.go index a13f27af..3f51529b 100644 --- a/controller/remote/controller.go +++ b/controller/remote/controller.go @@ -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)