From: Lennart Poettering Date: Wed, 1 Nov 2023 08:33:47 +0000 (+0100) Subject: man: explicitly mention that environment.d/ cannot be used to set the service manager... X-Git-Tag: v255-rc1~74 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bebf6fcf223c46f238184389befb2b05f4d2ff10;p=thirdparty%2Fsystemd.git man: explicitly mention that environment.d/ cannot be used to set the service manager's own env block Fixes: #29414 --- diff --git a/man/environment.d.xml b/man/environment.d.xml index 272211cbd42..fc03405a940 100644 --- a/man/environment.d.xml +++ b/man/environment.d.xml @@ -37,7 +37,7 @@ Description Configuration files in the environment.d/ directories contain lists of - environment variable assignments for services started by the systemd user instance. + environment variable assignments passed to services started by the systemd user instance. systemd-environment-d-generator8 parses them and updates the environment exported by the systemd user instance. See below for an discussion of which processes inherit those variables. @@ -91,18 +91,24 @@ Applicability - Environment variables exported by the user manager (systemd --user instance - started in the user@uid.service system service) apply to - any services started by that manager. In particular, this may include services which run user shells. For - example in the GNOME environment, the graphical terminal emulator runs as the + Environment variables exported by the user service manager (systemd --user + instance started in the user@uid.service system service) + are passed to any services started by that service manager. In particular, this may include services + which run user shells. For example in the GNOME environment, the graphical terminal emulator runs as the gnome-terminal-server.service user unit, which in turn runs the user shell, so that shell will inherit environment variables exported by the user manager. For other instances of the shell, - not launched by the user manager, the environment they inherit is defined by the program that starts - them. Hint: in general, - systemd.service5 - units contain programs launched by systemd, and - systemd.scope5 - units contain programs launched by something else. + not launched by the user service manager, the environment they inherit is defined by the program that + starts them. Hint: in general, + systemd.service5 units + contain programs launched by systemd, and + systemd.scope5 units + contain programs launched by something else. + + Note that these files do not affect the environment block of the service manager itself, but + exclusively the environment blocks passed to the services it manages. Environment variables set that way + thus cannot be used to influence behaviour of the service manager. In order to make changes to the + service manager's environment block the environment must be modified before the user's service manager is + invoked, for example from the system service manager or via a PAM module. Specifically, for ssh logins, the sshd8