BUG/MEDIUM: log: old processes with log foward section don't die on soft stop.
Old processes didn't die if a log foward section is declared and
a soft stop is requested.
This patch fix this issue and should be backpored in banches including
the log forward feature.
diff --git a/src/proxy.c b/src/proxy.c
index 18cdf42..eeb492e 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -1275,6 +1275,28 @@
stop_proxy(prs->peers_fe);
prs = prs->next;
}
+
+ p = cfg_log_forward;
+ while (p) {
+ /* Zombie proxy, let's close the file descriptors */
+ if (p->state == PR_STSTOPPED &&
+ !LIST_ISEMPTY(&p->conf.listeners) &&
+ LIST_ELEM(p->conf.listeners.n,
+ struct listener *, by_fe)->state > LI_ASSIGNED) {
+ struct listener *l;
+ list_for_each_entry(l, &p->conf.listeners, by_fe) {
+ if (l->state > LI_ASSIGNED)
+ close(l->rx.fd);
+ l->state = LI_INIT;
+ }
+ }
+
+ if (p->state != PR_STSTOPPED) {
+ stop_proxy(p);
+ }
+ p = p->next;
+ }
+
/* signal zero is used to broadcast the "stopping" event */
signal_handler(0);
}