teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

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

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