]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: startup: simplify check for calling sock_get_old_sockets
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 7 Oct 2024 08:40:35 +0000 (10:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
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.

src/haproxy.c

index d7a2fbd6134d2214cde6174fdb8ae545cfd46a09..e80dd103ffc3f55ce5dc90b69c90665bc6f398b2 100644 (file)
@@ -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");