MINOR: startup: reintroduce *env keywords support
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Sat, 12 Oct 2024 12:44:03 +0000 (14:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commitdc53c372349f30ff4fb9618e6bb131a0a8285855
tree55478ec0154df9425840b03364d866b84dc4bf38
parentd5ad92c7aa37e69bf6681e99365e29a322fa4e25
MINOR: startup: reintroduce *env keywords support

setenv/resetenv/presetenv/unsetenv keywords in the configuration modify the
process environment. In case of master-worker and programs we need to restore
the initial process environment before reload, as the configuration could
change in between and newly forked workers and programs should be launched
in the environment corresponded to this new configuration.

To achieve this we backup the initial process environment before the first
configuration read, when 'global' and 'program' sections are read. And then we
clean up master process environment and restore the initial one from the backup
in mworker_reexec().
src/haproxy.c