diff --git a/src/haproxy.c b/src/haproxy.c index e20f36052..e9198704b 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2217,7 +2217,14 @@ static void init(int argc, char **argv) */ global.nbtgroups = 1; global.nbthread = 1; - /* master CLI */ + + /* creates MASTER proxy and attaches server to child->ipc_fd[0] */ + if (mworker_cli_proxy_create() < 0) { + ha_alert("Can't create the master's CLI.\n"); + exit(EXIT_FAILURE); + } + + /* creates reload sockpair and listeners for master CLI (-S) */ mworker_create_master_cli(); } } diff --git a/src/mworker.c b/src/mworker.c index c125a1696..967bf7cfa 100644 --- a/src/mworker.c +++ b/src/mworker.c @@ -803,11 +803,6 @@ void mworker_create_master_cli(void) if (!LIST_ISEMPTY(&mworker_cli_conf)) { char *path = NULL; - if (mworker_cli_proxy_create() < 0) { - ha_alert("Can't create the master's CLI.\n"); - exit(EXIT_FAILURE); - } - list_for_each_entry_safe(c, it, &mworker_cli_conf, list) { if (mworker_cli_master_proxy_new_listener(c->s) == NULL) { ha_alert("Can't create the master's CLI.\n");