]> git.ipfire.org Git - thirdparty/systemd.git/commit - src/core/service.c
core: split environment block mantained by PID 1's Manager object in two 10594/head
authorLennart Poettering <lennart@poettering.net>
Wed, 31 Oct 2018 14:49:19 +0000 (15:49 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 31 Oct 2018 17:00:53 +0000 (18:00 +0100)
commit1ad6e8b302e87b6891a2bfc35ad397b0afe3d940
tree6774046555362e81a01127a86da8415e8d93a1f3
parentbea1a01310efdf51b8c609a300d49bf5c25509c3
core: split environment block mantained by PID 1's Manager object in two

This splits the "environment" field of Manager into two:
transient_environment and client_environment. The former is generated
from configuration file, kernel cmdline, environment generators. The
latter is the one the user can control with "systemctl set-environment"
and similar.

Both sets are merged transparently whenever needed. Separating the two
sets has the benefit that we can safely flush out the former while
keeping the latter during daemon reload cycles, so that env var settings
from env generators or configuration files do not accumulate, but
dynamic API changes are kept around.

Note that this change is not entirely transparent to users: if the user
first uses "set-environment" to override a transient variable, and then
uses "unset-environment" to unset it again things will revert to the
original transient variable now, while previously the variable was fully
removed. This change in behaviour should not matter too much though I
figure.

Fixes: #9972
src/core/dbus-manager.c
src/core/main.c
src/core/manager.c
src/core/manager.h
src/core/mount.c
src/core/service.c
src/core/socket.c
src/core/swap.c
src/core/unit.c
src/core/unit.h