MEDIUM: mworker: does not create the CLI proxy when no listener

Does not create the CLI proxy if no -S argument was specified. It
prevents a warning that says that the MASTER proxy does not have any
bind option.
This commit is contained in:
William Lallemand 2018-11-06 17:37:12 +01:00 committed by Willy Tarreau
parent 6b7cd0a72b
commit 550db6d188
2 changed files with 17 additions and 11 deletions

View File

@ -2105,6 +2105,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
*/ */
void mworker_cli_proxy_stop() void mworker_cli_proxy_stop()
{ {
if (mworker_proxy)
stop_proxy(mworker_proxy); stop_proxy(mworker_proxy);
} }

View File

@ -1736,6 +1736,8 @@ static void init(int argc, char **argv)
tmproc->pid = -1; tmproc->pid = -1;
tmproc->reloads = 0; tmproc->reloads = 0;
tmproc->relative_pid = 1 + proc; tmproc->relative_pid = 1 + proc;
tmproc->ipc_fd[0] = -1;
tmproc->ipc_fd[1] = -1;
if (mworker_cli_sockpair_new(tmproc, proc) < 0) { if (mworker_cli_sockpair_new(tmproc, proc) < 0) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -1745,6 +1747,9 @@ static void init(int argc, char **argv)
} }
mworker_env_to_proc_list(); /* get the info of the children in the env */ mworker_env_to_proc_list(); /* get the info of the children in the env */
if (!LIST_ISEMPTY(&mworker_cli_conf)) {
if (mworker_cli_proxy_create() < 0) { if (mworker_cli_proxy_create() < 0) {
ha_alert("Can't create the master's CLI.\n"); ha_alert("Can't create the master's CLI.\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -1760,7 +1765,7 @@ static void init(int argc, char **argv)
free(c->s); free(c->s);
free(c); free(c);
} }
}
} }
pattern_finalize_config(); pattern_finalize_config();