]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - man/environment.d.xml
Merge pull request #12414 from keszybz/detect-podman
[thirdparty/systemd.git] / man / environment.d.xml
index 2302992fa5b461afb235dc85ee7d366c744d131e..702154837bdec2e2b3109d7fc54c32cbf2e2a5c6 100644 (file)
@@ -1,39 +1,18 @@
 <?xml version="1.0"?>
 <!--*-nxml-*-->
-<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
 <!--
-  This file is part of systemd.
+  SPDX-License-Identifier: LGPL-2.1+
 
-  Copyright 2016 Red Hat, Inc.
-  Copyright 2017 Zbigniew Jędrzejewski-Szmek
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
+  Copyright © 2016 Red Hat, Inc.
 -->
-<refentry id="environment.d" xmlns:xi="http://www.w3.org/2001/XInclude">
+<refentry id="environment.d" conditional='ENABLE_ENVIRONMENT_D'
+    xmlns:xi="http://www.w3.org/2001/XInclude">
 
   <refentryinfo>
     <title>environment.d</title>
     <productname>systemd</productname>
-
-    <authorgroup>
-      <author>
-        <contrib>Developer</contrib>
-        <firstname>Ray</firstname>
-        <surname>Strode</surname>
-        <email>rstrode@redhat.com</email>
-      </author>
-    </authorgroup>
   </refentryinfo>
 
   <refmeta>
     <literal><replaceable>KEY</replaceable>=<replaceable>VALUE</replaceable></literal> environment
     variable assignments, separated by newlines. The right hand side of these assignments may
     reference previously defined environment variables, using the <literal>${OTHER_KEY}</literal>
-    and <literal>$OTHER_KEY</literal> format. No other elements of shell syntax are supported.
-    </para>
+    and <literal>$OTHER_KEY</literal> format. It is also possible to use
+
+    <literal>${<replaceable>FOO</replaceable>:-<replaceable>DEFAULT_VALUE</replaceable>}</literal>
+    to expand in the same way as <literal>${<replaceable>FOO</replaceable>}</literal> unless the
+    expansion would be empty, in which case it expands to <replaceable>DEFAULT_VALUE</replaceable>,
+    and use
+    <literal>${<replaceable>FOO</replaceable>:+<replaceable>ALTERNATE_VALUE</replaceable>}</literal>
+    to expand to <replaceable>ALTERNATE_VALUE</replaceable> as long as
+    <literal>${<replaceable>FOO</replaceable>}</literal> would have expanded to a non-empty value.
+    No other elements of shell syntax are supported.</para>
+
+    <para>Each <replaceable>KEY</replaceable> must be a valid variable name. Empty lines
+    and lines beginning with the comment character <literal>#</literal> are ignored.</para>
 
     <refsect2>
       <title>Example</title>
@@ -92,8 +82,8 @@
         <programlisting>
         FOO_DEBUG=force-software-gl,log-verbose
         PATH=/opt/foo/bin:$PATH
-        LD_LIBRARY_PATH=/opt/foo/lib
-        XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS}
+        LD_LIBRARY_PATH=/opt/foo/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
+        XDG_DATA_DIRS=/opt/foo/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/}
         </programlisting>
       </example>
     </refsect2>