Setting "localpeer" in the global section while "-L" is passed on the command
line makes haproxy refuse to load its configuration:
[ALERT] (447) : config : parsing [haproxy.cfg:428] : 'localpeer' ignored since it is already set by using the '-L' command line argument.
[ALERT] (447) : config : Error(s) found in configuration file : haproxy.cfg
[ALERT] (447) : config : Fatal errors found in configuration.
The intent of this check is that "-L" wins and "localpeer" is ignored, and the
documentation still advertises a warning for that case, as did 3.0. The parser
introduced by commit
d253f30823 ("MINOR: cfgparse-global: add
cfg_parse_global_localpeer") returns -1 there, which the global keyword
dispatcher turns into an alert and ERR_FATAL. Returning 1 instead makes it emit a
warning and set ERR_WARN, like the other "already specified, continuing" cases of
the same file (pidfile, chroot, tune.*), and the local peer name keeps being taken
from "-L".
Operators who share one configuration file and select the local peer with "-L" on
some instances only can no longer start haproxy at all and must edit their
configuration to work around it, hence the bug tag.
This should be backported to 3.1 and above, where
d253f30823 is present; the fix
is a single return value change and applies as-is to 3.1, 3.2, 3.3 and 3.4.