@@ -820,42 +820,50 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
820820 <listitem ><para >These options take a whitespace-separated list of directory names. The specified directory
821821 names must be relative, and may not include <literal >..</literal >. If set, one or more
822822 directories by the specified names will be created (including their parents) below the locations
823- defined in the following table, when the unit is started.</para >
823+ defined in the following table, when the unit is started. Also, the corresponding environment variable
824+ is defined with the full path of directories. If multiple directories are set, then int the environment variable
825+ the paths are concatenated with colon (<literal >:</literal >).</para >
824826 <table >
825- <title >Automatic directory creation</title >
826- <tgroup cols =' 3 ' >
827+ <title >Automatic directory creation and environment variables </title >
828+ <tgroup cols =' 4 ' >
827829 <thead >
828830 <row >
829831 <entry >Locations</entry >
830832 <entry >for system</entry >
831833 <entry >for users</entry >
834+ <entry >Environment variable</entry >
832835 </row >
833836 </thead >
834837 <tbody >
835838 <row >
836839 <entry ><varname >RuntimeDirectory=</varname ></entry >
837840 <entry ><filename >/run</filename ></entry >
838841 <entry ><varname >$XDG_RUNTIME_DIR</varname ></entry >
842+ <entry ><varname >$RUNTIME_DIRECTORY</varname ></entry >
839843 </row >
840844 <row >
841845 <entry ><varname >StateDirectory=</varname ></entry >
842846 <entry ><filename >/var/lib</filename ></entry >
843847 <entry ><varname >$XDG_CONFIG_HOME</varname ></entry >
848+ <entry ><varname >$STATE_DIRECTORY</varname ></entry >
844849 </row >
845850 <row >
846851 <entry ><varname >CacheDirectory=</varname ></entry >
847852 <entry ><filename >/var/cache</filename ></entry >
848853 <entry ><varname >$XDG_CACHE_HOME</varname ></entry >
854+ <entry ><varname >$CACHE_DIRECTORY</varname ></entry >
849855 </row >
850856 <row >
851857 <entry ><varname >LogsDirectory=</varname ></entry >
852858 <entry ><filename >/var/log</filename ></entry >
853859 <entry ><varname >$XDG_CONFIG_HOME</varname ><filename >/log</filename ></entry >
860+ <entry ><varname >$LOGS_DIRECTORY</varname ></entry >
854861 </row >
855862 <row >
856863 <entry ><varname >ConfigurationDirectory=</varname ></entry >
857864 <entry ><filename >/etc</filename ></entry >
858865 <entry ><varname >$XDG_CONFIG_HOME</varname ></entry >
866+ <entry ><varname >$CONFIGURATION_DIRECTORY</varname ></entry >
859867 </row >
860868 </tbody >
861869 </tgroup >
@@ -905,7 +913,13 @@ CapabilityBoundingSet=~CAP_B CAP_C</programlisting>
905913 <filename >/run/foo/bar</filename >, and <filename >/run/baz</filename >. The directories
906914 <filename >/run/foo/bar</filename > and <filename >/run/baz</filename > except <filename >/run/foo</filename > are
907915 owned by the user and group specified in <varname >User=</varname > and <varname >Group=</varname >, and removed
908- when the service is stopped.</para ></listitem >
916+ when the service is stopped.</para >
917+
918+ <para >Example: if a system service unit has the following,
919+ <programlisting >RuntimeDirectory=foo/bar
920+ StateDirectory=aaa/bbb ccc</programlisting >
921+ then the environment variable <literal >RUNTIME_DIRECTORY</literal > is set with <literal >/run/foo/bar</literal >, and
922+ <literal >STATE_DIRECTORY</literal > is set with <literal >/var/lib/aaa/bbb:/var/lib/ccc</literal >.</para ></listitem >
909923 </varlistentry >
910924
911925 <varlistentry >
0 commit comments