From 94ca26d0ea4a89e136b78fe106439c43f727e03d 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 7f567bfe..4c6c96cc 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ import ( "fmt" "net" "net/http" - "os" "os/signal" + "syscall" "code.pfad.fr/risefront" "github.com/0xJacky/Nginx-UI/internal/kernel" @@ -69,7 +69,7 @@ func main() { 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{