MINOR: mworker/cli: create MASTER proxy before mcli listeners

For the master process we always need to create a MASTER proxy, even if
master cli settings were not provided via command line, because now we bind a
listener in the master process context at ipc_fd[0]. So, MASTER proxy should be
already allocated at this moment.
This commit is contained in:
Valentine Krasnobaeva 2024-10-14 11:27:21 +02:00 committed by Willy Tarreau
parent 6ec38c9a74
commit 26ad5465cc
2 changed files with 8 additions and 6 deletions

View File

@ -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();
}
}

View File

@ -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");