Fixed router
This commit is contained in:
parent
8a528e2b4e
commit
3cd53b3dd9
@ -76,16 +76,16 @@ func main () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// be a daemon
|
// be a daemon
|
||||||
daemon.ShutdownOnSigint()
|
daemon.ShutdownOnSigint(&manager)
|
||||||
pidfile := daemon.PidFile(os.Getenv("HNAKRA_PIDFILE"))
|
pidfile := daemon.PidFile(os.Getenv("HNAKRA_PIDFILE"))
|
||||||
if !pidfile.Empty() {
|
if !pidfile.Empty() {
|
||||||
err := pidfile.Start()
|
err := pidfile.Start()
|
||||||
if err != nil { log.Println("!!! could not write pid:", err) }
|
if err != nil { log.Println("!!! could not write pid:", err) }
|
||||||
|
defer func () {
|
||||||
|
err := pidfile.Close()
|
||||||
|
if err != nil { log.Println("!!! could not delete pidfile:", err) }
|
||||||
|
} ()
|
||||||
}
|
}
|
||||||
defer func () {
|
|
||||||
err := pidfile.Close()
|
|
||||||
if err != nil { log.Println("!!! could not delete pidfile:", err) }
|
|
||||||
} ()
|
|
||||||
|
|
||||||
// run servers
|
// run servers
|
||||||
err = manager.Run()
|
err = manager.Run()
|
||||||
|
Loading…
Reference in New Issue
Block a user