From 3feb13e1676ae125d98af36e38fcac7999c879f2 Mon Sep 17 00:00:00 2001 From: Jan Baier Date: Thu, 9 Nov 2023 13:31:11 +0100 Subject: [PATCH] Fix handling of SIGTERM signal --- src/oled/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oled/main.go b/src/oled/main.go index 45bc500..6c9e36e 100644 --- a/src/oled/main.go +++ b/src/oled/main.go @@ -154,13 +154,13 @@ func main() { // Install signal handler signal_chan := make(chan os.Signal, 1) - signal.Notify(signal_chan, os.Interrupt, os.Kill) + signal.Notify(signal_chan, os.Interrupt, os.Kill, syscall.SIGTERM) go func() { for { s := <-signal_chan switch s { - case os.Interrupt, os.Kill: + case os.Interrupt, os.Kill, syscall.SIGTERM: log.Print("Exiting...") dev.Halt() bus.Close()