mirror of https://github.com/tidwall/tile38.git
Ignore SIGHUP signals
This commit is contained in:
parent
e05b3dc25c
commit
01112c9a4f
|
@ -291,7 +291,10 @@ 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 {
|
||||||
|
if s == syscall.SIGHUP {
|
||||||
|
continue
|
||||||
|
}
|
||||||
log.Warnf("signal: %v", s)
|
log.Warnf("signal: %v", s)
|
||||||
if pidfile != "" {
|
if pidfile != "" {
|
||||||
cleanup()
|
cleanup()
|
||||||
|
@ -299,8 +302,6 @@ Developer Options:
|
||||||
switch {
|
switch {
|
||||||
default:
|
default:
|
||||||
os.Exit(-1)
|
os.Exit(-1)
|
||||||
case s == syscall.SIGHUP:
|
|
||||||
os.Exit(1)
|
|
||||||
case s == syscall.SIGINT:
|
case s == syscall.SIGINT:
|
||||||
os.Exit(2)
|
os.Exit(2)
|
||||||
case s == syscall.SIGQUIT:
|
case s == syscall.SIGQUIT:
|
||||||
|
@ -308,6 +309,7 @@ Developer Options:
|
||||||
case s == syscall.SIGTERM:
|
case s == syscall.SIGTERM:
|
||||||
os.Exit(0xf)
|
os.Exit(0xf)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
// _____ _ _ ___ ___
|
// _____ _ _ ___ ___
|
||||||
|
|
Loading…
Reference in New Issue