mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-22 19:31:02 +01:00
BUG/MINOR: mworker: does not add the -sf in wait mode
Since the wait mode is automatically executed after charging the configuration, -sf was shown in argv[] with the previous PID, which is normal, but also the current one. This is only a visual problem when listing the processes, because -sf does not do anything in wait mode. Fix the issue by removing the whole "-sf" part in wait mode, but the executed command can be seen in the argv[] of the latest worker forked. Must be backported in 2.5.
This commit is contained in:
parent
7fbc7708d4
commit
befab9ee4a
@ -720,6 +720,7 @@ static void mworker_reexec()
|
||||
|
||||
/* insert the new options just after argv[0] in case we have a -- */
|
||||
|
||||
if (getenv("HAPROXY_MWORKER_WAIT_ONLY") == NULL) {
|
||||
/* add -sf <PID>* to argv */
|
||||
if (mworker_child_nb() > 0) {
|
||||
struct mworker_proc *child;
|
||||
@ -730,7 +731,7 @@ static void mworker_reexec()
|
||||
if (!(child->options & PROC_O_LEAVING) && (child->options & PROC_O_TYPE_WORKER))
|
||||
current_child = child;
|
||||
|
||||
if (!(child->options & (PROC_O_TYPE_WORKER|PROC_O_TYPE_PROG)) || child->pid <= -1 )
|
||||
if (!(child->options & (PROC_O_TYPE_WORKER|PROC_O_TYPE_PROG)) || child->pid <= -1)
|
||||
continue;
|
||||
if ((next_argv[next_argc++] = memprintf(&msg, "%d", child->pid)) == NULL)
|
||||
goto alloc_error;
|
||||
@ -738,9 +739,6 @@ static void mworker_reexec()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (getenv("HAPROXY_MWORKER_WAIT_ONLY") == NULL) {
|
||||
|
||||
if (current_child) {
|
||||
/* add the -x option with the socketpair of the current worker */
|
||||
next_argv[next_argc++] = "-x";
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user