mworker_create_master_cli() creates MASTER proxy and allocates listeners,
which are attached to this proxy. It also creates a reload sockpair.
So, it's more appropriate to do the check, that we are in a MODE_MWORKER, if
master CLI settings were provided via command line, just after the config
parsing. And only then, if runtime mode and command line settings are
coherent, try to perform master-worker fork and try to create master CLI.
exit(1);
}
+ if (!LIST_ISEMPTY(&mworker_cli_conf) && !(arg_mode & MODE_MWORKER)) {
+ ha_alert("a master CLI socket was defined, but master-worker mode (-W) is not enabled.\n");
+ exit(EXIT_FAILURE);
+ }
+
if (global.mode & MODE_MWORKER) {
struct mworker_proc *tmproc;
if (master)
mworker_create_master_cli();
- if (!LIST_ISEMPTY(&mworker_cli_conf) && !(arg_mode & MODE_MWORKER)) {
- ha_alert("a master CLI socket was defined, but master-worker mode (-W) is not enabled.\n");
- exit(EXIT_FAILURE);
- }
-
/* destroy unreferenced defaults proxies */
proxy_destroy_all_unref_defaults();