]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: global: add MODE_DISCOVERY flag
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 1 Oct 2024 13:40:53 +0000 (15:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
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.

include/haproxy/global-t.h

index 600c9ab212b701f52ed67e96f337b2fb87bcf010..dda39705db6ee7377f307895750ddc4227e0cfb0 100644 (file)
@@ -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 */