MEDIUM: mworker: stop the master proxy in the workers

The master proxy which handles the CLI should not be used or shown in
the stats of the workers. This proxy is now disabled after the fork.
This commit is contained in:
William Lallemand 2018-10-26 14:47:45 +02:00 committed by Willy Tarreau
parent 0b3e849a48
commit 309dc9adec
3 changed files with 13 additions and 0 deletions

View File

@ -28,9 +28,12 @@ void cli_register_kw(struct cli_kw_list *kw_list);
int cli_has_level(struct appctx *appctx, int level); int cli_has_level(struct appctx *appctx, int level);
/* mworker proxy functions */
int mworker_cli_proxy_create(); int mworker_cli_proxy_create();
int mworker_cli_proxy_new_listener(char *line); int mworker_cli_proxy_new_listener(char *line);
int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc); int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc);
void mworker_cli_proxy_stop();
/* proxy mode cli functions */ /* proxy mode cli functions */

View File

@ -2073,6 +2073,14 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit)
* The mworker functions are used to initialize the CLI in the master process * The mworker functions are used to initialize the CLI in the master process
*/ */
/*
* Stop the mworker proxy
*/
void mworker_cli_proxy_stop()
{
stop_proxy(mworker_proxy);
}
/* /*
* Create the mworker CLI proxy * Create the mworker CLI proxy
*/ */

View File

@ -3058,6 +3058,8 @@ int main(int argc, char **argv)
struct mworker_proc *child, *it; struct mworker_proc *child, *it;
master = 0; master = 0;
mworker_cli_proxy_stop();
/* free proc struct of other processes */ /* free proc struct of other processes */
list_for_each_entry_safe(child, it, &proc_list, list) { list_for_each_entry_safe(child, it, &proc_list, list) {
/* close the FD of the master side for all /* close the FD of the master side for all