Skip to content

Commit 6a7f5af

Browse files
committed
add log for successfull reload
1 parent 9375432 commit 6a7f5af

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@ func main() {
9292
log.Warning("reload failed")
9393
continue
9494
}
95+
go func() {
96+
select {
97+
case <-cmd.Terminated:
98+
// old haproxy terminated - successfully started a new process replacing the old one
99+
log.Notice(fmt.Sprintf("process %d terminated : %s", cmd.Process.Pid, cmd.Status()))
100+
log.Notice("reload successful")
101+
}
102+
}()
95103

96104
cmd = tmp
97105
log.Notice(fmt.Sprintf("started process with pid %d and status %s", tmp.Process.Pid, tmp.Status()))

0 commit comments

Comments
 (0)