From a499f2fd0564f1579f7243450a921866c7c31bdf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 May 2022 16:38:20 +0800 Subject: [PATCH] fix: exit with nohup (#106) (#118) Co-authored-by: Vee Zhang --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 4ac4901..50082cc 100644 --- a/main.go +++ b/main.go @@ -64,7 +64,10 @@ func main() { */ done := make(chan bool, 1) quit := make(chan os.Signal, 1) - signal.Notify(quit, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) + signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) + if !signal.Ignored(syscall.SIGHUP) { + signal.Notify(quit, syscall.SIGHUP) + } go func() { <-quit