teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0791-man-document-RUNTIME_DIRECTORY-or-friends.patch

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