summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2009-06-09 14:36:00 +0200
committerWilly Tarreau <w@1wt.eu>2009-07-14 20:12:15 +0200
commitf20cad6b3214f2b1b3db7fbeeecc0ef109185c2d (patch)
tree3193a5d614300ce0968c246aa3bfca4285b52633 /src
parentb885b7eb6e12b0f0cfd2fa7d692830e696dabe68 (diff)
downloadhaproxy-f20cad6b3214f2b1b3db7fbeeecc0ef109185c2d.tar.gz
[BUG] ensure that we correctly re-start old process in case of error
When a new process fails to grab some ports, it sends a signal to the old process in order to release them. Then it tries to bind again. If it still fails (eg: one of the ports is bound to a completely different process), it must send the continue signal to the old process so that this one re-binds to the ports. This is correctly done, but the newly bound ports are not released first, which sometimes causes the old process to remain running with no port bound. The fix simply consists in unbinding all ports before sending the signal to the old process. (cherry picked from commit f68da4603a092f35af627c459dbc714d9fa796e9)
Diffstat (limited to 'src')
-rw-r--r--src/haproxy.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/haproxy.c b/src/haproxy.c
index e656859e1..68c8b4b47 100644
--- a/src/haproxy.c
+++ b/src/haproxy.c
@@ -950,8 +950,10 @@ int main(int argc, char **argv)
/* Note: start_proxies() sends an alert when it fails. */
if ((err & ~ERR_WARN) != ERR_NONE) {
- if (retry != MAX_START_RETRIES && nb_oldpids)
+ if (retry != MAX_START_RETRIES && nb_oldpids) {
+ protocol_unbind_all(); /* cleanup everything we can */
tell_old_pids(SIGTTIN);
+ }
exit(1);
}