mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2024-11-21 20:45:33 +03:00
if coredns unexpectedly quits, restart it
This commit is contained in:
parent
2244c21b76
commit
656d092ad6
1 changed files with 8 additions and 3 deletions
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 a new issue