From c31577f32e0094010516a923e9f5e8cc23c23d43 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Tue, 26 Jul 2022 10:50:09 +0200 Subject: [PATCH] MEDIUM: resolvers: continue startup if network is unavailable When haproxy starts with a resolver section, and there is a default one since 2.6 which use /etc/resolv.conf, it tries to do a connect() with the UDP socket in order to check if the routes of the system allows to reach the server. This check is too much restrictive as it won't prevent any runtime failure. Relax the check by making it a warning instead of a fatal alert. This must be backported in 2.6. --- src/resolvers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resolvers.c b/src/resolvers.c index c7267aafca..f325f39c3f 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -2509,10 +2509,10 @@ static int resolvers_finalize_config(void) continue; } if (connect(fd, (struct sockaddr*)&ns->dgram->conn.addr.to, get_addr_len(&ns->dgram->conn.addr.to)) == -1) { - ha_alert("resolvers '%s': can't connect socket for nameserver '%s'.\n", + ha_warning("resolvers '%s': can't connect socket for nameserver '%s'.\n", resolvers->id, ns->id); close(fd); - err_code |= (ERR_ALERT|ERR_ABORT); + err_code |= ERR_WARN; continue; } close(fd); -- 2.39.5