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.
#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 */