mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
BUG/MINOR: startup: set GTUNE_SOCKET_TRANSFER correctly
This bug was forbidding the GTUNE_SOCKET_TRANSFER option to be set when haproxy is neither in daemon mode nor in mworker mode. So it basically only impacts the foreground mode. The fix moves the code outside the 'if (global.mode & (MODE_DAEMON | MODE_MWORKER | MODE_MWORKER_WAIT))' condition. Bug was introduced with 7f80eb23 ("MEDIUM: proxy: zombify proxies only when the expose-fd socket is bound"). Must be backported in every stable version.
This commit is contained in:
parent
db09cd6ad4
commit
ef9a195742
@ -3750,22 +3750,6 @@ int main(int argc, char **argv)
|
|||||||
ha_free(&global.chroot);
|
ha_free(&global.chroot);
|
||||||
set_identity(argv[0]);
|
set_identity(argv[0]);
|
||||||
|
|
||||||
/* pass through every cli socket, and check if it's bound to
|
|
||||||
* the current process and if it exposes listeners sockets.
|
|
||||||
* Caution: the GTUNE_SOCKET_TRANSFER is now set after the fork.
|
|
||||||
* */
|
|
||||||
|
|
||||||
if (global.cli_fe) {
|
|
||||||
struct bind_conf *bind_conf;
|
|
||||||
|
|
||||||
list_for_each_entry(bind_conf, &global.cli_fe->conf.bind, by_fe) {
|
|
||||||
if (bind_conf->level & ACCESS_FD_LISTENERS) {
|
|
||||||
global.tune.options |= GTUNE_SOCKET_TRANSFER;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is only done in daemon mode because we might want the
|
* This is only done in daemon mode because we might want the
|
||||||
* logs on stdout in mworker mode. If we're NOT in QUIET mode,
|
* logs on stdout in mworker mode. If we're NOT in QUIET mode,
|
||||||
@ -3787,6 +3771,22 @@ int main(int argc, char **argv)
|
|||||||
fork_poller();
|
fork_poller();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* pass through every cli socket, and check if it's bound to
|
||||||
|
* the current process and if it exposes listeners sockets.
|
||||||
|
* Caution: the GTUNE_SOCKET_TRANSFER is now set after the fork.
|
||||||
|
* */
|
||||||
|
|
||||||
|
if (global.cli_fe) {
|
||||||
|
struct bind_conf *bind_conf;
|
||||||
|
|
||||||
|
list_for_each_entry(bind_conf, &global.cli_fe->conf.bind, by_fe) {
|
||||||
|
if (bind_conf->level & ACCESS_FD_LISTENERS) {
|
||||||
|
global.tune.options |= GTUNE_SOCKET_TRANSFER;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Note that here we can't be in the parent/master anymore */
|
/* Note that here we can't be in the parent/master anymore */
|
||||||
#if !defined(USE_THREAD) && defined(USE_CPU_AFFINITY)
|
#if !defined(USE_THREAD) && defined(USE_CPU_AFFINITY)
|
||||||
if (ha_cpuset_count(&cpu_map[0].thread[0])) { /* only do this if the process has a CPU map */
|
if (ha_cpuset_count(&cpu_map[0].thread[0])) { /* only do this if the process has a CPU map */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user