]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: startup: HAPROXY_STARTUP_VERSION contains the version used to start
authorWilliam Lallemand <wlallemand@haproxy.org>
Tue, 21 Feb 2023 13:07:05 +0000 (14:07 +0100)
committerWilliam Lallemand <wlallemand@haproxy.org>
Tue, 21 Feb 2023 13:16:45 +0000 (14:16 +0100)
HAPROXY_STARTUP_VERSION: contains the version used to start, in
master-worker mode this is the version which was used to start the
master, even after updating the binary and reloading.

This patch could be backported in every version since it is useful when
debugging.

doc/configuration.txt
src/haproxy.c

index 370b96022c1fbba67c52e283574909f9f12e96cd..beae7db870913e9acdb8def2db3bd1b85cf07bf6 100644 (file)
@@ -778,6 +778,10 @@ file, or could be inherited by a program (See 3.7. Programs):
 * HAPROXY_MASTER_CLI: In master-worker mode, listeners addresses of the master
   CLI, separated by semicolons.
 
+* HAPROXY_STARTUP_VERSION: contains the version used to start, in master-worker
+  mode this is the version which was used to start the master, even after
+  updating the binary and reloading.
+
 In addition, some pseudo-variables are internally resolved and may be used as
 regular variables. Pseudo-variables always start with a dot ('.'), and are the
 only ones where the dot is permitted. The current list of pseudo-variables is:
index 3025d5afe640e4391cd6655475689e82c41bfe73..308f41873ccaa97b2ea89d4c62eb38e4ad616feb 100644 (file)
@@ -1490,6 +1490,8 @@ static void init_early(int argc, char **argv)
        char *tmp;
        int len;
 
+       setenv("HAPROXY_STARTUP_VERSION", HAPROXY_VERSION, 0);
+
        /* First, let's initialize most global variables */
        totalconn = actconn = listeners = stopping = 0;
        killed = pid = 0;