From 814ca4cf6f55db2e8932f340f65f1c20b996672a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 10 Oct 2025 18:28:09 +0200 Subject: [PATCH] man/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better The description of ME= said "see above", but it was actually above the other one. So change the order. But while reading this, I found it very hard to understand. So reword things, hopefully in a way that is easier to understand. The current behaviour is rather complex and unintuitive, but this description just tries to describe it truthfully. (cherry picked from commit 938f7fea7c953e5f5e9e199a5fcd22ac84fd1240) --- man/systemd-system.conf.xml | 50 ++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/man/systemd-system.conf.xml b/man/systemd-system.conf.xml index 164cfee1ed9..cf5a3612f69 100644 --- a/man/systemd-system.conf.xml +++ b/man/systemd-system.conf.xml @@ -640,35 +640,15 @@ Environment - - ManagerEnvironment= - - Takes the same arguments as DefaultEnvironment=, see above. Sets - environment variables for the manager process itself. These variables are inherited by processes - spawned by user managers, but not the system manager - use DefaultEnvironment= - for that. Note that these variables are merged into the existing environment block. In particular, in - case of the system manager, this includes variables set by the kernel based on the kernel command line. - As with DefaultEnvironment=, this environment block is internal, and changes are not - reflected in the manager's /proc/PID/environ. - - Setting environment variables for the manager process may be useful to modify its behaviour. - See Known Environment Variables for a - descriptions of some variables understood by systemd. - - Simple %-specifier expansion is supported, see below for a list of supported - specifiers. - - - - - DefaultEnvironment= Configures environment variables passed to all executed processes. Takes a space-separated list of variable assignments. See environ7 for - details about environment variables. + details about environment variables. This environment block is internal, and changes are not + reflected in the manager's /proc/PID/environ. + Simple %-specifier expansion is supported, see below for a list of supported specifiers. @@ -684,6 +664,30 @@ + + + ManagerEnvironment= + + Sets environment variables for the manager process itself. Takes a space-separated + list of variable assignment in the same format as DefaultEnvironment=, see above. + These variables are merged into the existing environment block of the manager process. In particular, + in case of the system manager, this block includes variables set by the kernel based on the kernel + command line, and in case of the user manager, the variables passed by the system manager. After + those variables have been merged, they will persist until overriden, even if the manager is reloaded + or reexecuted. In case of the user manager, these variables are also inherited by processes spawned + by the manager. As with DefaultEnvironment=, this environment block is internal, + and changes are not reflected in the manager's /proc/PID/environ. + + Setting environment variables for the manager process may be useful to modify its behaviour. + See Known Environment Variables for a description + of some variables understood by systemd. + + Simple %-specifier expansion is supported, see below for a list of supported + specifiers. + + + + -- 2.47.3