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)
|
signal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
|
||||||
go func() {
|
go func() {
|
||||||
s := <-c
|
for s := range c {
|
||||||
log.Warnf("signal: %v", s)
|
if s == syscall.SIGHUP {
|
||||||
if pidfile != "" {
|
continue
|
||||||
cleanup()
|
}
|
||||||
}
|
log.Warnf("signal: %v", s)
|
||||||
switch {
|
if pidfile != "" {
|
||||||
default:
|
cleanup()
|
||||||
os.Exit(-1)
|
}
|
||||||
case s == syscall.SIGHUP:
|
switch {
|
||||||
os.Exit(1)
|
default:
|
||||||
case s == syscall.SIGINT:
|
os.Exit(-1)
|
||||||
os.Exit(2)
|
case s == syscall.SIGINT:
|
||||||
case s == syscall.SIGQUIT:
|
os.Exit(2)
|
||||||
os.Exit(3)
|
case s == syscall.SIGQUIT:
|
||||||
case s == syscall.SIGTERM:
|
os.Exit(3)
|
||||||
os.Exit(0xf)
|
case s == syscall.SIGTERM:
|
||||||
|
os.Exit(0xf)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue