From: dongshengyuan <545258830@qq.com> Date: Mon, 29 Jun 2026 05:24:51 +0000 (+0800) Subject: man: document that $XDG_CONFIG_HOME affects environment.d lookup path X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b0d48e096c463f0be47b2ea0bc305d003b9f1505;p=thirdparty%2Fsystemd.git man: document that $XDG_CONFIG_HOME affects environment.d lookup path Align the documentation with the actual behavior: if $XDG_CONFIG_HOME is set to an absolute path in the user service manager environment, it takes precedence over the default ~/.config/ when locating environment.d files. Also note the bootstrapping limitation that variables defined inside environment.d files are not yet available when the generator runs. Fixes: #42777 Signed-off-by: dongshengyuan --- diff --git a/man/environment.d.xml b/man/environment.d.xml index 0b00296d6e5..ee83b673abf 100644 --- a/man/environment.d.xml +++ b/man/environment.d.xml @@ -45,6 +45,13 @@ parses them and updates the environment exported by the systemd user instance. See below for an discussion of which processes inherit those variables. + The user-level configuration directory defaults to ~/.config/environment.d/. + If $XDG_CONFIG_HOME is set to an absolute path in the user service manager + environment (e.g. via PAM or /etc/environment), it takes precedence over + ~/.config/. Note that this creates a bootstrapping consideration: variables + set in environment.d/ files, including $XDG_CONFIG_HOME + itself, are not available when the generator determines which directory to read. + It is recommended to use numerical prefixes for file names to simplify ordering. For backwards compatibility, a symlink to /etc/environment is