]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: cfgparse-global: move 'pidfile' in global keywords list
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 14 Aug 2024 12:57:16 +0000 (14:57 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 20 Aug 2024 17:16:30 +0000 (19:16 +0200)
commit450ce3e61b93760198f15556c74171ee7975cb21
tree0a4a50946c1dbdd75e56f2f41f3ff7262583f5de
parentf29be97ac7255d85372479323f460aeaba81d7ba
MINOR: cfgparse-global: move 'pidfile' in global keywords list

This commit cleans up cfg_parse_global() and prepares the config parser to
support MODE_DISCOVERY. This step is needed in early starting stage, just to
figura out in which mode the process was started, to set some necessary
parameteres needed for this mode and to continue the initialization
stage.

'pidfile' makes part of such common keywords, which are needed to be parsed
very early and which are used almost in all process modes (except the
foreground, '-d').

'pidfile' keyword parser is called by section parser and follows the common
API, i.e. it returns -1 on failure, 0 on success and 1 on recoverable error. In
case of recoverable error we've previously returned ERR_ALERT (0x10) and we have
emitted an alert message at startup. Section parser treats all rc > 0 as
ERR_WARN. So in case, if pidfile was already specified via command line, the
keyword parser will return 1 (in order to respect the common API), section
parser will treat this as ERR_WARN and a warning message will be emitted during
process startup instead of alert, as it was before.
src/cfgparse-global.c