Browse Source

[bug fix]weed daemon exit due to hangup signal when terminal close

pull/210/head
tianshimao 9 years ago
parent
commit
3c48d871d1
  1. 4
      go/weed/signal_handling.go

4
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)

Loading…
Cancel
Save