From: Willy Tarreau Date: Thu, 8 Feb 2018 08:55:09 +0000 (+0100) Subject: BUG/MINOR: config: don't emit a warning when global stats is incompletely configured X-Git-Tag: v1.9-dev1~428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58aa5ccd7675e5c960b045e96fdf69845d6449b4;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: don't emit a warning when global stats is incompletely configured Martin Brauer reported an unexpected warning when some parts of the global stats are defined but not the listening address, like below : global #stats socket run/admin.sock mode 660 level admin stats timeout 30s Then haproxy complains : [WARNING] 334/150131 (23086) : config : frontend 'GLOBAL' has no 'bind' directive. Please declare it as a backend if this was intended. This is because of the check for a bind-less frontend (the global section creates a frontend for the stats). There's no clean fix for this one, so here we're simply checking that the frontend is not the global stats one before emitting the warning. This patch should be backported to all stable versions. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 2e10e3537f..17b1dd0360 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -7727,7 +7727,7 @@ int check_config_validity() break; } - if ((curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) { + if (curproxy != global.stats_fe && (curproxy->cap & PR_CAP_FE) && LIST_ISEMPTY(&curproxy->conf.listeners)) { ha_warning("config : %s '%s' has no 'bind' directive. Please declare it as a backend if this was intended.\n", proxy_type_str(curproxy), curproxy->id); err_code |= ERR_WARN;