]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: mworker: stop the master proxy in the workers
authorWilliam Lallemand <wlallemand@haproxy.com>
Fri, 26 Oct 2018 12:47:45 +0000 (14:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 28 Oct 2018 13:03:31 +0000 (14:03 +0100)
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.

include/proto/cli.h
src/cli.c
src/haproxy.c

index 74052f714efc51299bd980bdd4f6f4eb580ebc82..c41c8bf9aac9d89d33a340142848f962ebc8cf09 100644 (file)
@@ -28,9 +28,12 @@ void cli_register_kw(struct cli_kw_list *kw_list);
 
 int cli_has_level(struct appctx *appctx, int level);
 
+/* mworker proxy functions */
+
 int mworker_cli_proxy_create();
 int mworker_cli_proxy_new_listener(char *line);
 int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc);
+void mworker_cli_proxy_stop();
 
 /* proxy mode cli functions */
 
index 4ed8b93f369cef6212d9133e5473b322237ef68a..6e7c3d0c9be0e78daa81663d060b44fd6b866e9f 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -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
  */
 
+ /*
+ * Stop the mworker proxy
+ */
+void mworker_cli_proxy_stop()
+{
+       stop_proxy(mworker_proxy);
+}
+
 /*
  * Create the mworker CLI proxy
  */
index 4e6d243030d790a8f8973588eca633fb0b8ccaa2..81db3e0fdea3f897054a1756c2a6eaed01ce6b1d 100644 (file)
@@ -3058,6 +3058,8 @@ int main(int argc, char **argv)
                        struct mworker_proc *child, *it;
                        master = 0;
 
+                       mworker_cli_proxy_stop();
+
                        /* free proc struct of other processes  */
                        list_for_each_entry_safe(child, it, &proc_list, list) {
                                /* close the FD of the master side for all