From: Valentine Krasnobaeva Date: Mon, 7 Oct 2024 08:40:35 +0000 (+0200) Subject: MINOR: startup: simplify check for calling sock_get_old_sockets X-Git-Tag: v3.1-dev10~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4e73b4302c4a5d4ef6ba8ab3fba420c6bffc48b;p=thirdparty%2Fhaproxy.git MINOR: startup: simplify check for calling sock_get_old_sockets MODE_CHECK and MODE_CHECK_CONDITION are applied now very early in step_init_1() and step_init_2() in order to check the configuration or to check some condition provided via the command line. When these checks have terminated, the main process exits. So, no longer need to verify these modes at the moment, when the current process have already done its basic initialization routines and is asking for listeners sockets from the previously started one. --- diff --git a/src/haproxy.c b/src/haproxy.c index d7a2fbd613..e80dd103ff 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3547,8 +3547,7 @@ int main(int argc, char **argv) * _getsocks on the stat socket, it must never been done in wait mode * and check mode */ - if (old_unixsocket && - !(global.mode & (MODE_MWORKER|MODE_CHECK|MODE_CHECK_CONDITION))) { + if (old_unixsocket && !(global.mode & MODE_MWORKER)) { if (strcmp("/dev/null", old_unixsocket) != 0) { if (sock_get_old_sockets(old_unixsocket) != 0) { ha_alert("Failed to get the sockets from the old process!\n");