]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: config: allow to manipulate environment variables in the global section
authorWilly Tarreau <w@1wt.eu>
Tue, 16 Feb 2016 11:41:57 +0000 (12:41 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Feb 2016 11:44:54 +0000 (12:44 +0100)
commit1d54972789c00e504f6e396c8c2046d718fda26f
treef1f9a1baa4c2cf657a7a97eb0cd5caa69a88457b
parentae79572f89969a19f9f04063e0d4c97b0381f549
MEDIUM: config: allow to manipulate environment variables in the global section

With new init systems such as systemd, environment variables became a
real mess because they're only considered on startup but not on reload
since the init script's variables cannot be passed to the process that
is signaled to reload.

This commit introduces an alternative method consisting in making it
possible to modify the environment from the global section with directives
like "setenv", "unsetenv", "presetenv" and "resetenv".

Since haproxy supports loading multiple config files, it now becomes
possible to put the host-dependant variables in one file and to
distribute the rest of the configuration to all nodes, without having
to deal with the init system's deficiencies.

Environment changes take effect immediately when the directives are
processed, so it's possible to do perform the same operations as are
usually performed in regular service config files.
doc/configuration.txt
src/cfgparse.c