Skip to content

Commit e634c75

Browse files
Hintay0xJacky
authored andcommitted
fix: catch process termination signal to clear socket file
1 parent 45d98f5 commit e634c75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"fmt"
1111
"net"
1212
"net/http"
13-
"os"
1413
"os/signal"
14+
"syscall"
1515

1616
"github.com/0xJacky/Nginx-UI/internal/cert"
1717
"github.com/0xJacky/Nginx-UI/internal/cmd"
@@ -108,7 +108,7 @@ func main() {
108108
confPath := appCmd.String("config")
109109
settings.Init(confPath)
110110

111-
ctx, cancel := signal.NotifyContext(context.Background(), os.Interrupt)
111+
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
112112
defer cancel()
113113

114114
err := risefront.New(ctx, risefront.Config{

0 commit comments

Comments
 (0)