mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 07:54:33 +00:00
MINOR: mworker: write parent pid in the pidfile
The first pid in the pidfile is now the parent, it's more convenient for supervising the processus. You can now reload haproxy in master-worker mode with convenient command like: kill -USR2 $(head -1 /tmp/haproxy.pid)
This commit is contained in:
parent
8029300df6
commit
deed780a22
@ -2631,6 +2631,13 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
/* if in master-worker mode, write the PID of the father */
|
||||
if (global.mode & MODE_MWORKER) {
|
||||
char pidstr[100];
|
||||
snprintf(pidstr, sizeof(pidstr), "%d\n", getpid());
|
||||
shut_your_big_mouth_gcc(write(pidfd, pidstr, strlen(pidstr)));
|
||||
}
|
||||
|
||||
/* the father launches the required number of processes */
|
||||
for (proc = 0; proc < global.nbproc; proc++) {
|
||||
ret = fork();
|
||||
|
Loading…
Reference in New Issue
Block a user