diff --git a/src/haproxy.c b/src/haproxy.c index 5ed6c7edb..b934850cf 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3714,6 +3714,15 @@ int main(int argc, char **argv) */ step_init_1(); + /* deserialize processes list, if we do reload in master-worker mode */ + if ((getenv("HAPROXY_MWORKER_REEXEC") != NULL)) { + if (mworker_env_to_proc_list() < 0) { + ha_alert("Master failed to deserialize monitored processes list, " + "it's a non-recoverable error, exiting.\n"); + exit(EXIT_FAILURE); + } + } + /* parse conf in disovery mode and set modes from config */ read_cfg_in_discovery_mode(argc, argv); diff --git a/src/mworker.c b/src/mworker.c index 31374eafc..874bfd1f6 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -845,11 +845,6 @@ void mworker_create_master_cli(void) { struct wordlist *it, *c; - /* get the info of the children in the env */ - if (mworker_env_to_proc_list() < 0) { - exit(EXIT_FAILURE); - } - if (!LIST_ISEMPTY(&mworker_cli_conf)) { char *path = NULL;