This file is part of systemd.
Copyright 2010 Brandon Philips
-
- 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/>.
-->
<refentry id="tmpfiles.d">
</refnamediv>
<refsynopsisdiv>
- <para><filename>/etc/tmpfiles.d/*.conf</filename></para>
- <para><filename>/run/tmpfiles.d/*.conf</filename></para>
- <para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
+ <para><literallayout><filename>/etc/tmpfiles.d/*.conf</filename>
+<filename>/run/tmpfiles.d/*.conf</filename>
+<filename>/usr/lib/tmpfiles.d/*.conf</filename>
+ </literallayout></para>
+
+ <para><literallayout><filename>~/.config/user-tmpfiles.d/*.conf</filename>
+<filename>$XDG_RUNTIME_DIR/user-tmpfiles.d/*.conf</filename>
+<filename>~/.local/share/user-tmpfiles.d/*.conf</filename>
+<filename>…</filename>
+<filename>/usr/share/user-tmpfiles.d/*.conf</filename>
+ </literallayout></para>
</refsynopsisdiv>
<refsect1>
<variablelist>
<varlistentry>
<term><varname>f</varname></term>
- <listitem><para>Create a file if it does not exist yet. If
- the argument parameter is given, it will be written to the
- file. Does not follow symlinks.</para></listitem>
+ <listitem><para>Create a file if it does not exist yet. If the argument parameter is given and the file did
+ not exist yet, it will be written to the file. Does not follow symlinks.</para></listitem>
</varlistentry>
<varlistentry>
The second line in contrast to the first one would break a
running system, and will only be executed with
<option>--boot</option>.</para>
+
+ <para>Note that for all line types that result in creation of any kind of file node
+ (i.e. <varname>f</varname>/<varname>F</varname>,
+ <varname>d</varname>/<varname>D</varname>/<varname>v</varname>/<varname>q</varname>/<varname>Q</varname>,
+ <varname>p</varname>, <varname>L</varname>, <varname>c</varname>/<varname>b</varname> and <varname>C</varname>)
+ leading directories are implicitly created if needed, owned by root with an access mode of 0755. In order to
+ create them with different modes or ownership make sure to add appropriate <varname>d</varname> lines.</para>
</refsect2>
<refsect2>
<literal>~</literal>, the clean-up is only applied to files and
directories one level inside the directory specified, but not
the files and directories immediately inside it.</para>
+
+ <para>The age of a file system entry is determined from its last
+ modification timestamp (mtime), its last access timestamp (atime),
+ and (except for directories) its last status change timestamp
+ (ctime). Any of these three (or two) values will prevent cleanup
+ if it is more recent than the current time minus the age
+ field.</para>
</refsect2>
<refsect2>
<title>Argument</title>
- <para>For <varname>L</varname> lines determines the destination
- path of the symlink. For <varname>c</varname> and
- <varname>b</varname>, determines the major/minor of the device
- node, with major and minor formatted as integers, separated by
- <literal>:</literal>, e.g. <literal>1:3</literal>. For
- <varname>f</varname>, <varname>F</varname>, and
- <varname>w</varname>, the argument may be used to specify a short string that
- is written to the file, suffixed by a newline. For
- <varname>C</varname>, specifies the source file or
- directory. For <varname>t</varname> and <varname>T</varname>,
- determines extended attributes to be set. For
- <varname>a</varname> and <varname>A</varname>, determines ACL
- attributes to be set. For <varname>h</varname> and
- <varname>H</varname>, determines the file attributes to
- set. Ignored for all other lines.</para>
+ <para>For <varname>L</varname> lines determines the destination path of the symlink. For <varname>c</varname> and
+ <varname>b</varname>, determines the major/minor of the device node, with major and minor formatted as integers,
+ separated by <literal>:</literal>, e.g. <literal>1:3</literal>. For <varname>f</varname>, <varname>F</varname>,
+ and <varname>w</varname>, the argument may be used to specify a short string that is written to the file,
+ suffixed by a newline. For <varname>C</varname>, specifies the source file or directory. For <varname>t</varname>
+ and <varname>T</varname>, determines extended attributes to be set. For <varname>a</varname> and
+ <varname>A</varname>, determines ACL attributes to be set. For <varname>h</varname> and <varname>H</varname>,
+ determines the file attributes to set. Ignored for all other lines.</para>
<para>This field can contain specifiers, see below.</para>
</refsect2>
<entry>User home directory</entry>
<entry>This is the home directory of the user running the service manager instance. In case of the system manager this resolves to <literal>/root</literal>.</entry>
</row>
+ <row>
+ <entry><literal>%t</literal></entry>
+ <entry>System or user runtime directory</entry>
+ <entry>In --user mode, this is the same <varname>$XDG_RUNTIME_DIR</varname>, and <filename>/run</filename> otherwise.</entry>
+ </row>
+ <row>
+ <entry><literal>%S</literal></entry>
+ <entry>System or user state directory</entry>
+ <entry>In <option>--user</option> mode, this is the same as <varname>$XDG_CONFIG_HOME</varname>, and <filename>/var/lib</filename> otherwise.</entry>
+ </row>
+ <row>
+ <entry><literal>%C</literal></entry>
+ <entry>System or user cache directory</entry>
+ <entry>In <option>--user</option> mode, this is the same as <varname>$XDG_CACHE_HOME</varname>, and <filename>/var/cache</filename> otherwise.</entry>
+ </row>
+ <row>
+ <entry><literal>%L</literal></entry>
+ <entry>System or user log directory</entry>
+ <entry>In <option>--user</option> mode, this is the same as <varname>$XDG_CONFIG_HOME</varname> with <filename noindex='true'>/log</filename> appended, and <filename>/var/log</filename> otherwise.</entry>
+ </row>
<row>
<entry><literal>%%</literal></entry>
- <entry>Escaped %</entry>
+ <entry>Escaped <literal>%</literal></entry>
<entry>Single percent sign.</entry>
</row>
</tbody>
</programlisting>
<para>Contents of <filename>/run/screens</filename> and /run/uscreens will
- cleaned up after 10 and 10½ days, respectively.</para>
+ be cleaned up after 10 and 10½ days, respectively.</para>
</example>
<example>