if coredns unexpectedly quits, restart it
This commit is contained in:
parent
2244c21b76
commit
656d092ad6
11
control.go
11
control.go
|
@ -142,9 +142,14 @@ func handleStart(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
func childwaiter() {
|
||||
err := coreDNSCommand.Wait()
|
||||
log.Printf("coredns terminated: %s\n", err)
|
||||
err = coreDNSCommand.Process.Release()
|
||||
log.Printf("coredns released: %s\n", err)
|
||||
log.Printf("coredns unexpectedly died: %s\n", err)
|
||||
coreDNSCommand.Process.Release()
|
||||
log.Printf("restarting coredns\n", err)
|
||||
err = startDNSServer()
|
||||
if err != nil {
|
||||
log.Printf("Couldn't restart DNS server: %s\n", err)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
func handleStop(w http.ResponseWriter, r *http.Request) {
|
||||
|
|
Loading…
Reference in New Issue