Fix issue in watchdog - not reading false config overrides.

This commit is contained in:
Alex Ellis
2017-04-05 09:06:47 +01:00
committed by Alex Ellis
parent 93bdfba4b2
commit 469fc690da
9 changed files with 80 additions and 16 deletions

View File

@ -136,9 +136,11 @@ func main() {
http.HandleFunc("/", makeRequestHandler(&config))
if config.suppressLock == false {
writeErr := ioutil.WriteFile("/tmp/.lock", []byte{}, 0660)
path := "/tmp/.lock"
log.Printf("Writing lock-file to: %s\n", path)
writeErr := ioutil.WriteFile(path, []byte{}, 0660)
if writeErr != nil {
log.Panicf("Cannot write /tmp/.lock for healthcheck: %s \n", writeErr.Error())
log.Panicf("Cannot write %s. Error: %s\n", path, writeErr.Error())
}
}