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() {
|
func childwaiter() {
|
||||||
err := coreDNSCommand.Wait()
|
err := coreDNSCommand.Wait()
|
||||||
log.Printf("coredns terminated: %s\n", err)
|
log.Printf("coredns unexpectedly died: %s\n", err)
|
||||||
err = coreDNSCommand.Process.Release()
|
coreDNSCommand.Process.Release()
|
||||||
log.Printf("coredns released: %s\n", err)
|
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) {
|
func handleStop(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
Loading…
Reference in New Issue