]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
man/systemd-systemd.conf: describe DefaultEnvironment= and ManagerEnvironment= better
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 Oct 2025 16:28:09 +0000 (18:28 +0200)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 6 Nov 2025 14:13:33 +0000 (14:13 +0000)
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

index 164cfee1ed963cf43fea13bb0178c513406e79b2..cf5a3612f695fe8cda01b9b3021505432083a425 100644 (file)
     <title>Environment</title>
 
     <variablelist class='config-directives'>
-      <varlistentry>
-        <term><varname>ManagerEnvironment=</varname></term>
-
-        <listitem><para>Takes the same arguments as <varname>DefaultEnvironment=</varname>, 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 <varname>DefaultEnvironment=</varname>
-        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 <varname>DefaultEnvironment=</varname>, this environment block is internal, and changes are not
-        reflected in the manager's <filename>/proc/PID/environ</filename>.</para>
-
-        <para>Setting environment variables for the manager process may be useful to modify its behaviour.
-        See <ulink url="https://systemd.io/ENVIRONMENT">Known Environment Variables</ulink> for a
-        descriptions of some variables understood by <command>systemd</command>.</para>
-
-        <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
-        specifiers.</para>
-
-        <xi:include href="version-info.xml" xpointer="v248"/>
-        </listitem>
-      </varlistentry>
-
       <varlistentry>
         <term><varname>DefaultEnvironment=</varname></term>
 
         <listitem><para>Configures environment variables passed to all executed processes. Takes a
         space-separated list of variable assignments. See <citerefentry
         project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
-        details about environment variables.</para>
+        details about environment variables. This environment block is internal, and changes are not
+        reflected in the manager's <filename>/proc/PID/environ</filename>.
+        </para>
 
         <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
         specifiers.</para>
 
         <xi:include href="version-info.xml" xpointer="v205"/></listitem>
       </varlistentry>
+
+      <varlistentry>
+        <term><varname>ManagerEnvironment=</varname></term>
+
+        <listitem><para>Sets environment variables for the manager process itself. Takes a space-separated
+        list of variable assignment in the same format as <varname>DefaultEnvironment=</varname>, 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 <varname>DefaultEnvironment=</varname>, this environment block is internal,
+        and changes are not reflected in the manager's <filename>/proc/PID/environ</filename>.</para>
+
+        <para>Setting environment variables for the manager process may be useful to modify its behaviour.
+        See <ulink url="https://systemd.io/ENVIRONMENT">Known Environment Variables</ulink> for a description
+        of some variables understood by <command>systemd</command>.</para>
+
+        <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
+        specifiers.</para>
+
+        <xi:include href="version-info.xml" xpointer="v248"/>
+        </listitem>
+      </varlistentry>
     </variablelist>
   </refsect1>