]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man: document that $XDG_CONFIG_HOME affects environment.d lookup path
authordongshengyuan <545258830@qq.com>
Mon, 29 Jun 2026 05:24:51 +0000 (13:24 +0800)
committerLennart Poettering <lennart@poettering.net>
Tue, 30 Jun 2026 07:00:11 +0000 (09:00 +0200)
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 <dongshengyuan@uniontech.com>
man/environment.d.xml

index 0b00296d6e5dd13e5ba7ca738ebe3d9e78ac9bd4..ee83b673abf96bc8143093e49e6cb79dd228b01b 100644 (file)
     parses them and updates the environment exported by the systemd user instance. See below for an
     discussion of which processes inherit those variables.</para>
 
+    <para>The user-level configuration directory defaults to <filename>~/.config/environment.d/</filename>.
+    If <varname>$XDG_CONFIG_HOME</varname> is set to an absolute path in the user service manager
+    environment (e.g. via PAM or <filename>/etc/environment</filename>), it takes precedence over
+    <filename>~/.config/</filename>. Note that this creates a bootstrapping consideration: variables
+    set in <filename>environment.d/</filename> files, including <varname>$XDG_CONFIG_HOME</varname>
+    itself, are not available when the generator determines which directory to read.</para>
+
     <para>It is recommended to use numerical prefixes for file names to simplify ordering.</para>
 
     <para>For backwards compatibility, a symlink to <filename>/etc/environment</filename> is