From e634c75804c94e4622c87ffd8ad24d6273039024 Mon Sep 17 00:00:00 2001 From: Hintay Date: Thu, 7 Nov 2024 00:07:30 +0900 Subject: [PATCH] fix: catch process termination signal to clear socket file --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 42e56b7a..4f779438 100644 --- a/main.go +++ b/main.go @@ -10,8 +10,8 @@ import ( "fmt" "net" "net/http" - "os" "os/signal" + "syscall" "github.com/0xJacky/Nginx-UI/internal/cert" "github.com/0xJacky/Nginx-UI/internal/cmd" @@ -108,7 +108,7 @@ func main() { confPath := appCmd.String("config") settings.Init(confPath) - ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt) + ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) defer cancel() err := risefront.New(ctx, risefront.Config{