From bf3266e757ebcc6a970d37d8a479168aec1f5ffd 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:02 +0800 Subject: [PATCH] fix: exit with nohup (#106) (#119) Co-authored-by: Vee Zhang --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 72033e7..cf81033 100644 --- a/main.go +++ b/main.go @@ -86,7 +86,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