ryantimwilson / rpms / systemd

Forked from rpms/systemd a month ago
Clone
b7dd4d
From a729ea1a59b63c5f3e7fdce6a6c4e2ce12faa972 Mon Sep 17 00:00:00 2001
b7dd4d
From: Yu Watanabe <watanabe.yu+github@gmail.com>
b7dd4d
Date: Tue, 11 Sep 2018 14:24:47 +0900
b7dd4d
Subject: [PATCH] man: document RUNTIME_DIRECTORY= or friends
b7dd4d
b7dd4d
(cherry picked from commit d491e65e74a92898d6e7f95032b5b037c6e3cb60)
b7dd4d
b7dd4d
Related: #2049788
b7dd4d
---
b7dd4d
 man/systemd.exec.xml | 22 ++++++++++++++++++----
b7dd4d
 1 file changed, 18 insertions(+), 4 deletions(-)
b7dd4d
b7dd4d
diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
b7dd4d
index 696438c4ef..dc88cf9781 100644
b7dd4d
--- a/man/systemd.exec.xml
b7dd4d
+++ b/man/systemd.exec.xml
b7dd4d
@@ -820,15 +820,18 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
b7dd4d
         <listitem><para>These options take a whitespace-separated list of directory names. The specified directory
b7dd4d
         names must be relative, and may not include <literal>..</literal>. If set, one or more
b7dd4d
         directories by the specified names will be created (including their parents) below the locations
b7dd4d
-        defined in the following table, when the unit is started.</para>
b7dd4d
+        defined in the following table, when the unit is started. Also, the corresponding environment variable
b7dd4d
+        is defined with the full path of directories. If multiple directories are set, then int the environment variable
b7dd4d
+        the paths are concatenated with colon (<literal>:</literal>).</para>
b7dd4d
         
b7dd4d
-          <title>Automatic directory creation</title>
b7dd4d
-          <tgroup cols='3'>
b7dd4d
+          <title>Automatic directory creation and environment variables</title>
b7dd4d
+          <tgroup cols='4'>
b7dd4d
             
b7dd4d
               <row>
b7dd4d
                 <entry>Locations</entry>
b7dd4d
                 <entry>for system</entry>
b7dd4d
                 <entry>for users</entry>
b7dd4d
+                <entry>Environment variable</entry>
b7dd4d
               </row>
b7dd4d
             
b7dd4d
             
b7dd4d
@@ -836,26 +839,31 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
b7dd4d
                 <entry><varname>RuntimeDirectory=</varname></entry>
b7dd4d
                 <entry><filename>/run</filename></entry>
b7dd4d
                 <entry><varname>$XDG_RUNTIME_DIR</varname></entry>
b7dd4d
+                <entry><varname>$RUNTIME_DIRECTORY</varname></entry>
b7dd4d
               </row>
b7dd4d
               <row>
b7dd4d
                 <entry><varname>StateDirectory=</varname></entry>
b7dd4d
                 <entry><filename>/var/lib</filename></entry>
b7dd4d
                 <entry><varname>$XDG_CONFIG_HOME</varname></entry>
b7dd4d
+                <entry><varname>$STATE_DIRECTORY</varname></entry>
b7dd4d
               </row>
b7dd4d
               <row>
b7dd4d
                 <entry><varname>CacheDirectory=</varname></entry>
b7dd4d
                 <entry><filename>/var/cache</filename></entry>
b7dd4d
                 <entry><varname>$XDG_CACHE_HOME</varname></entry>
b7dd4d
+                <entry><varname>$CACHE_DIRECTORY</varname></entry>
b7dd4d
               </row>
b7dd4d
               <row>
b7dd4d
                 <entry><varname>LogsDirectory=</varname></entry>
b7dd4d
                 <entry><filename>/var/log</filename></entry>
b7dd4d
                 <entry><varname>$XDG_CONFIG_HOME</varname><filename>/log</filename></entry>
b7dd4d
+                <entry><varname>$LOGS_DIRECTORY</varname></entry>
b7dd4d
               </row>
b7dd4d
               <row>
b7dd4d
                 <entry><varname>ConfigurationDirectory=</varname></entry>
b7dd4d
                 <entry><filename>/etc</filename></entry>
b7dd4d
                 <entry><varname>$XDG_CONFIG_HOME</varname></entry>
b7dd4d
+                <entry><varname>$CONFIGURATION_DIRECTORY</varname></entry>
b7dd4d
               </row>
b7dd4d
             
b7dd4d
           </tgroup>
b7dd4d
@@ -905,7 +913,13 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
b7dd4d
         <filename>/run/foo/bar</filename>, and <filename>/run/baz</filename>. The directories
b7dd4d
         <filename>/run/foo/bar</filename> and <filename>/run/baz</filename> except <filename>/run/foo</filename> are
b7dd4d
         owned by the user and group specified in <varname>User=</varname> and <varname>Group=</varname>, and removed
b7dd4d
-        when the service is stopped.</para></listitem>
b7dd4d
+        when the service is stopped.</para>
b7dd4d
+
b7dd4d
+        <para>Example: if a system service unit has the following,
b7dd4d
+        <programlisting>RuntimeDirectory=foo/bar
b7dd4d
+StateDirectory=aaa/bbb ccc</programlisting>
b7dd4d
+        then the environment variable <literal>RUNTIME_DIRECTORY</literal> is set with <literal>/run/foo/bar</literal>, and
b7dd4d
+        <literal>STATE_DIRECTORY</literal> is set with <literal>/var/lib/aaa/bbb:/var/lib/ccc</literal>.</para></listitem>
b7dd4d
       </varlistentry>
b7dd4d
 
b7dd4d
       <varlistentry>