From: Valentine Krasnobaeva Date: Tue, 1 Oct 2024 13:40:53 +0000 (+0200) Subject: MINOR: global: add MODE_DISCOVERY flag X-Git-Tag: v3.1-dev10~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6769745fe597d0e22f87b90d00436670a846bb83;p=thirdparty%2Fhaproxy.git MINOR: global: add MODE_DISCOVERY flag This is the first commit from a series to add a support of discovery mode in the configuration parser and in initialization sequence. Discovery mode is the mode, when we read the configuration at the first time and we parse and set runtime modes: daemon, zero-warning, master-worker. In this mode we also parse some parameters needed for the master process to start, in case if we are in the master-worker mode. Like this the master process doesn't allocate any additional resources, which it doesn't use and it quickly finishes its initialization and enters to its polling loop. The worker process after its fork reads the rest of the configuration. So, let's add in this commit MODE_DISCOVERY flag to check it in configuration parser functions. --- diff --git a/include/haproxy/global-t.h b/include/haproxy/global-t.h index 600c9ab212..dda39705db 100644 --- a/include/haproxy/global-t.h +++ b/include/haproxy/global-t.h @@ -44,6 +44,7 @@ #define MODE_DUMP_KWD 0x4000 /* dump registered keywords (see kwd_dump for the list) */ #define MODE_DUMP_CFG 0x8000 /* dump the configuration file */ #define MODE_DUMP_NB_L 0x10000 /* dump line numbers when the configuration file is dump */ +#define MODE_DISCOVERY 0x20000 /* parse only keywords with KW_DISCOVERY flag to discover other global modes, i.e. daemon, master-worker */ /* list of last checks to perform, depending on config options */ #define LSTCHK_SYSADM 0x00000001 /* check that we have CAP_SYS_ADMIN */