mirror of https://github.com/tidwall/tile38.git
Ignore SIGHUP signals
This commit is contained in:
parent
e05b3dc25c
commit
01112c9a4f
|
@ -291,22 +291,24 @@ Developer Options:
|
|||
|
||||
signal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
||||
go func() {
|
||||
s := <-c
|
||||
log.Warnf("signal: %v", s)
|
||||
if pidfile != "" {
|
||||
cleanup()
|
||||
}
|
||||
switch {
|
||||
default:
|
||||
os.Exit(-1)
|
||||
case s == syscall.SIGHUP:
|
||||
os.Exit(1)
|
||||
case s == syscall.SIGINT:
|
||||
os.Exit(2)
|
||||
case s == syscall.SIGQUIT:
|
||||
os.Exit(3)
|
||||
case s == syscall.SIGTERM:
|
||||
os.Exit(0xf)
|
||||
for s := range c {
|
||||
if s == syscall.SIGHUP {
|
||||
continue
|
||||
}
|
||||
log.Warnf("signal: %v", s)
|
||||
if pidfile != "" {
|
||||
cleanup()
|
||||
}
|
||||
switch {
|
||||
default:
|
||||
os.Exit(-1)
|
||||
case s == syscall.SIGINT:
|
||||
os.Exit(2)
|
||||
case s == syscall.SIGQUIT:
|
||||
os.Exit(3)
|
||||
case s == syscall.SIGTERM:
|
||||
os.Exit(0xf)
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in New Issue