mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
man: document that "systemctl set-environment" cannot be used to unset env vars configured via config file
Fixes: #28167
This commit is contained in:
parent
afc194a135
commit
c104d7a74e
|
@ -1363,36 +1363,49 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
|
||||||
<term><command>show-environment</command></term>
|
<term><command>show-environment</command></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Dump the systemd manager environment block. This is the environment
|
<para>Dump the systemd manager environment block. This is the environment block that is passed to
|
||||||
block that is passed to all processes the manager spawns. The environment
|
all processes the manager spawns. The environment block will be dumped in straightforward form
|
||||||
block will be dumped in straightforward form suitable for sourcing into
|
suitable for sourcing into most shells. If no special characters or whitespace is present in the
|
||||||
most shells. If no special characters or whitespace is present in the variable
|
variable values, no escaping is performed, and the assignments have the form
|
||||||
values, no escaping is performed, and the assignments have the form
|
<literal>VARIABLE=value</literal>. If whitespace or characters which have special meaning to the
|
||||||
<literal>VARIABLE=value</literal>. If whitespace or characters which have
|
shell are present, dollar-single-quote escaping is used, and assignments have the form
|
||||||
special meaning to the shell are present, dollar-single-quote escaping is
|
<literal>VARIABLE=$'value'</literal>. This syntax is known to be supported by <citerefentry
|
||||||
used, and assignments have the form <literal>VARIABLE=$'value'</literal>.
|
project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||||
This syntax is known to be supported by
|
<citerefentry
|
||||||
<citerefentry project='die-net'><refentrytitle>bash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
||||||
<citerefentry project='die-net'><refentrytitle>zsh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
<citerefentry
|
||||||
<citerefentry project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
project='die-net'><refentrytitle>ksh</refentrytitle><manvolnum>1</manvolnum></citerefentry>, and
|
||||||
and
|
<citerefentry
|
||||||
<citerefentry project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
|
project='die-net'><refentrytitle>busybox</refentrytitle><manvolnum>1</manvolnum></citerefentry>'s
|
||||||
<citerefentry project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
|
<citerefentry
|
||||||
but not
|
project='die-net'><refentrytitle>ash</refentrytitle><manvolnum>1</manvolnum></citerefentry>, but
|
||||||
<citerefentry project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry>
|
not <citerefentry
|
||||||
or
|
project='die-net'><refentrytitle>dash</refentrytitle><manvolnum>1</manvolnum></citerefentry> or
|
||||||
<citerefentry project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
<citerefentry
|
||||||
|
project='die-net'><refentrytitle>fish</refentrytitle><manvolnum>1</manvolnum></citerefentry>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
|
<para>Note that this shows the <emphasis>effective</emphasis> block, i.e. the combination of
|
||||||
|
environment variables configured via configuration files, environment generators and via IPC
|
||||||
|
(i.e. via the <command>set-environment</command> described below). At the moment a unit process
|
||||||
|
is forked off this combined environment block will be further combined with per-unit environment
|
||||||
|
variables, which are not visible in this command.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
|
<term><command>set-environment <replaceable>VARIABLE=VALUE</replaceable>…</command></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Set one or more systemd manager environment variables, as specified on the command
|
<para>Set one or more service manager environment variables, as specified on the command
|
||||||
line. This command will fail if variable names and values do not conform to the rules listed
|
line. This command will fail if variable names and values do not conform to the rules listed
|
||||||
above.</para>
|
above.</para>
|
||||||
|
|
||||||
|
<para>Note that this operates on an environment block separate from the environment block
|
||||||
|
configured from service manager configuration and environment generators. Whenever a process is
|
||||||
|
invoked the two blocks are combined (also incorporating any per-service environment variables),
|
||||||
|
and passed to it. The <command>show-environment</command> verb will show the combination of the
|
||||||
|
blocks, see above.</para>
|
||||||
|
|
||||||
<xi:include href="version-info.xml" xpointer="v233"/>
|
<xi:include href="version-info.xml" xpointer="v233"/>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1400,11 +1413,16 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
|
||||||
<term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
|
<term><command>unset-environment <replaceable>VARIABLE</replaceable>…</command></term>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Unset one or more systemd manager environment
|
<para>Unset one or more systemd manager environment variables. If only a variable name is
|
||||||
variables. If only a variable name is specified, it will be
|
specified, it will be removed regardless of its value. If a variable and a value are specified,
|
||||||
removed regardless of its value. If a variable and a value
|
the variable is only removed if it has the specified value.</para>
|
||||||
are specified, the variable is only removed if it has the
|
|
||||||
specified value.</para>
|
<para>Note that this operates on an environment block separate from the environment block
|
||||||
|
configured from service manager configuration and environment generators. Whenever a process is
|
||||||
|
invoked the two blocks are combined (also incorporating any per-service environment variables),
|
||||||
|
and passed to it. The <command>show-environment</command> verb will show the combination of the
|
||||||
|
blocks, see above. Note that this means this command cannot be used to unset environment
|
||||||
|
variables defined in the service manager configuration files or via generators.</para>
|
||||||
|
|
||||||
<xi:include href="version-info.xml" xpointer="v233"/>
|
<xi:include href="version-info.xml" xpointer="v233"/>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
Loading…
Reference in a new issue