MEDIUM: mworker-prog: implement program for master-worker
This patch implements the external binary support in the master worker.
To configure an external process, you need to use the program section,
for example:
program dataplane-api
command ./dataplane_api
Those processes are launched at the same time as the workers.
During a reload of HAProxy, those processes are dealing with the same
sequence as a worker:
- the master is re-executed
- the master sends a USR1 signal to the program
- the master launches a new instance of the program
During a stop, or restart, a SIGTERM is sent to the program.
diff --git a/include/proto/mworker.h b/include/proto/mworker.h
index 02a10de..bf8317f 100644
--- a/include/proto/mworker.h
+++ b/include/proto/mworker.h
@@ -33,5 +33,7 @@
int mworker_child_nb();
+int mworker_ext_launch_all();
+
#endif /* PROTO_MWORKER_H_ */
diff --git a/include/types/global.h b/include/types/global.h
index 6b06e7f..306c874 100644
--- a/include/types/global.h
+++ b/include/types/global.h
@@ -187,6 +187,9 @@
int pid;
char type; /* m(aster), w(orker) */
/* 3 bytes hole here */
+ char *id;
+ char **command;
+ char *path;
int ipc_fd[2]; /* 0 is master side, 1 is worker side */
int relative_pid;
int reloads;