diff options
| author | tianshimao <tianshimao@qyvideo.cn> | 2015-10-19 14:39:11 +0800 |
|---|---|---|
| committer | tianshimao <tianshimao@qyvideo.cn> | 2015-10-19 14:39:11 +0800 |
| commit | 3c48d871d1f6e1a74f42b6a11110015e9bd3311b (patch) | |
| tree | 41ce1fbb91550131a82b4042eda52abb6213571d | |
| parent | 5feae4f74c5b3cd82cb8ba3623883d06c003b24f (diff) | |
| download | seaweedfs-3c48d871d1f6e1a74f42b6a11110015e9bd3311b.tar.xz seaweedfs-3c48d871d1f6e1a74f42b6a11110015e9bd3311b.zip | |
[bug fix]weed daemon exit due to hangup signal when terminal close
| -rw-r--r-- | go/weed/signal_handling.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/go/weed/signal_handling.go b/go/weed/signal_handling.go index d26e3495e..61554c5df 100644 --- a/go/weed/signal_handling.go +++ b/go/weed/signal_handling.go @@ -11,11 +11,13 @@ import ( func OnInterrupt(fn func()) { // deal with control+c,etc signalChan := make(chan os.Signal, 1) + // controlling terminal close, daemon not exit + signal.Ignore(syscall.SIGHUP) signal.Notify(signalChan, os.Interrupt, os.Kill, syscall.SIGALRM, - syscall.SIGHUP, + // syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT) |
