From: William Lallemand Date: Tue, 26 Jul 2022 08:50:09 +0000 (+0200) Subject: MEDIUM: resolvers: continue startup if network is unavailable X-Git-Tag: v2.7-dev3~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c31577f;p=thirdparty%2Fhaproxy.git 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. --- 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);