1
0
mirror of https://github.com/systemd/systemd synced 2025-11-21 01:34:44 +01:00

Compare commits

..

No commits in common. "53ff5b361ffb4a9550a0125e7868d1e82d634ba7" and "de2276cdcd34e8932483e66331e0ecb12f177145" have entirely different histories.

3 changed files with 37 additions and 39 deletions

View File

@ -353,7 +353,7 @@
particular, if the device is used for a mount point, the mount point itself also needs to particular, if the device is used for a mount point, the mount point itself also needs to
have the <option>nofail</option> option, or the boot will fail if the device is not unlocked have the <option>nofail</option> option, or the boot will fail if the device is not unlocked
successfully. If a keyfile and/or a <option>header</option> are specified, the dependencies on successfully. If a keyfile and/or a <option>header</option> are specified, the dependencies on
their respective directories will also not be fatal, so that unmounting said directories will their respective directories will also not be fatal, so that umounting said directories will
not cause the generated cryptset unit to be deactivated.</para> not cause the generated cryptset unit to be deactivated.</para>
<xi:include href="version-info.xml" xpointer="v186"/></listitem> <xi:include href="version-info.xml" xpointer="v186"/></listitem>

View File

@ -640,15 +640,35 @@
<title>Environment</title> <title>Environment</title>
<variablelist class='config-directives'> <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> <varlistentry>
<term><varname>DefaultEnvironment=</varname></term> <term><varname>DefaultEnvironment=</varname></term>
<listitem><para>Configures environment variables passed to all executed processes. Takes a <listitem><para>Configures environment variables passed to all executed processes. Takes a
space-separated list of variable assignments. See <citerefentry space-separated list of variable assignments. See <citerefentry
project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for project='man-pages'><refentrytitle>environ</refentrytitle><manvolnum>7</manvolnum></citerefentry> for
details about environment variables. This environment block is internal, and changes are not details about environment variables.</para>
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 <para>Simple <literal>%</literal>-specifier expansion is supported, see below for a list of supported
specifiers.</para> specifiers.</para>
@ -664,30 +684,6 @@
<xi:include href="version-info.xml" xpointer="v205"/></listitem> <xi:include href="version-info.xml" xpointer="v205"/></listitem>
</varlistentry> </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> </variablelist>
</refsect1> </refsect1>

View File

@ -2810,24 +2810,26 @@ static int parse_configuration(const struct rlimit *saved_rlimit_nofile,
log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m"); log_warning_errno(r, "Failed to parse kernel command line, ignoring: %m");
} }
/* Initialize the show status setting if it hasn't been explicitly set yet */
if (arg_show_status == _SHOW_STATUS_INVALID)
arg_show_status = SHOW_STATUS_YES;
/* Push variables into the manager environment block */
setenv_manager_environment();
/* Parse log environment variables to take into account any new environment variables.
* Note that this also parses bits from the kernel command line, including "debug". */
log_parse_environment();
/* Initialize some default rlimits for services if they haven't been configured */ /* Initialize some default rlimits for services if they haven't been configured */
fallback_rlimit_nofile(saved_rlimit_nofile); fallback_rlimit_nofile(saved_rlimit_nofile);
fallback_rlimit_memlock(saved_rlimit_memlock); fallback_rlimit_memlock(saved_rlimit_memlock);
/* Note that this also parses bits from the kernel command line, including "debug". */
log_parse_environment();
/* Initialize the show status setting if it hasn't been set explicitly yet */
if (arg_show_status == _SHOW_STATUS_INVALID)
arg_show_status = SHOW_STATUS_YES;
/* Slightly raise the OOM score for our services if we are running for unprivileged users. */ /* Slightly raise the OOM score for our services if we are running for unprivileged users. */
determine_default_oom_score_adjust(); determine_default_oom_score_adjust();
/* Push variables into the manager environment block */
setenv_manager_environment();
/* Parse log environment variables again to take into account any new environment variables. */
log_parse_environment();
return 0; return 0;
} }