BUG/MINOR: startup: set HAPROXY_CFGFILES in read_cfg
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 12 Nov 2024 21:43:34 +0000 (22:43 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Wed, 13 Nov 2024 08:50:05 +0000 (09:50 +0100)
commit1f0cd91fe77525ad0e0dcf20da206e5f6a4853a0
tree76f662d88ecb4a1b9400c522871471b661d28548
parentd5d41dee3daf01314d65e053faf3cab52ea6929e
BUG/MINOR: startup: set HAPROXY_CFGFILES in read_cfg

load_cfg() is called only once before the first reading of the configuration
(we parse here only the global section). Then, before reading the rest of the
sections (second call of read_cfg()), we call clean_env(). As
HAPROXY_CFGFILES is set in load_cfg(), which is called only once, clean_env()
erases it. Thus, it's not longer shown in "show env" output.

To fix this, let's set HAPROXY_CFGFILES in read_cfg(). Like this in
master-worker mode it is set for master and for worker processes, as it was
before the refactoring.

This fix doesn't need to be backported as related to the latest master-worker
architecture change.
src/haproxy.c