BUG/MEDIUM: startup: don't daemonize if started with -c
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 9 Dec 2024 11:00:35 +0000 (12:00 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Dec 2024 10:09:53 +0000 (11:09 +0100)
commitc13ef1d973e96f1bdba3c93252473ab6ba12fee8
treee267d25aa903549cece65075d003147bb0d1be47
parent206070161cc83a41a3a0bd68777fab4e9d32bdd0
BUG/MEDIUM: startup: don't daemonize if started with -c

Due to master-worker refactoring, daemonization fork happens now very early,
before parsing and verifying the configuration. For the moment there is no
any specific syntax, which needs for the daemon mode to be really applied in
order to perform the tests.

So, it's better not to do the daemonization fork, if 'daemon' keyword is
presented in the config (or -D option), when we started with -c (MODE_CHECK).
Like this, during the config verification, the process will always stay in
foreground and all warning or errors will be delivered to the stdout.

This fix should be backported only in 3.1.

(cherry picked from commit 5f94e98d8958ff0003bfbb736427070d16270d6e)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/haproxy.c