tmpfiles.d.xml revision 062e01bbdbc3201e4c99bc0b702cb04a0ae2190c
2N/A<?xml version="1.0"?>
2N/A<!--*-nxml-*-->
2N/A<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
2N/A<!--
2N/A This file is part of systemd.
2N/A
2N/A Copyright 2010 Brandon Philips
2N/A
2N/A systemd is free software; you can redistribute it and/or modify it
2N/A under the terms of the GNU General Public License as published by
2N/A the Free Software Foundation; either version 2 of the License, or
2N/A (at your option) any later version.
2N/A
2N/A systemd is distributed in the hope that it will be useful, but
2N/A WITHOUT ANY WARRANTY; without even the implied warranty of
2N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2N/A General Public License for more details.
2N/A
2N/A You should have received a copy of the GNU General Public License
2N/A along with systemd; If not, see <http://www.gnu.org/licenses/>.
700N/A-->
2N/A<refentry id="tmpfiles.d">
2N/A
2N/A <refentryinfo>
2N/A <title>tmpfiles.d</title>
2N/A <productname>systemd</productname>
2N/A
2N/A <authorgroup>
2N/A <author>
2N/A <contrib>Documentation</contrib>
2N/A <firstname>Brandon</firstname>
59N/A <surname>Philips</surname>
59N/A <email>brandon@ifup.org</email>
2N/A </author>
2N/A </authorgroup>
2N/A </refentryinfo>
2N/A
26N/A <refmeta>
26N/A <refentrytitle>tmpfiles.d</refentrytitle>
2N/A <manvolnum>5</manvolnum>
26N/A </refmeta>
38N/A
181N/A <refnamediv>
26N/A <refname>tmpfiles.d</refname>
26N/A <refpurpose>Configuration for creation, deletion and
26N/A cleaning of volatile and temporary files</refpurpose>
26N/A </refnamediv>
26N/A
26N/A <refsynopsisdiv>
26N/A <para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para>
26N/A <para><filename>/etc/tmpfiles.d/*.conf</filename></para>
700N/A <para><filename>/run/tmpfiles.d/*.conf</filename></para>
700N/A </refsynopsisdiv>
26N/A
26N/A <refsect1>
26N/A <title>Description</title>
26N/A
151N/A <para><command>systemd-tmpfiles</command> uses the
206N/A configuration files from the above directories to describe the
26N/A creation, cleaning and removal of volatile and
26N/A temporary files and directories which usually reside
26N/A in directories such as <filename>/run</filename>
26N/A or <filename>/tmp</filename>.</para>
26N/A </refsect1>
26N/A
26N/A <refsect1>
2N/A <title>Configuration Format</title>
26N/A
26N/A <para>Each configuration file is named in the style of
26N/A <filename>&lt;program&gt;.conf</filename>.
26N/A Files in <filename>/etc/</filename> overwrite
26N/A files with the same name in <filename>/usr/lib/</filename>.
26N/A Files in <filename>/run</filename> overwrite files with
26N/A the same name in <filename>/etc/</filename> and
26N/A <filename>/usr/lib/</filename>. Packages should install their
586N/A configuration files in <filename>/usr/lib/</filename>, files
26N/A in <filename>/etc/</filename> are reserved for the local
93N/A administration, which possibly decides to overwrite the
166N/A configurations installed from packages. All files are sorted
26N/A by filename in alphabetical order, regardless in which of the
379N/A directories they reside, to ensure that a specific
379N/A configuration file takes precedence over another file with
2N/A an alphabetically later name.</para>
26N/A
26N/A <para>The configuration format is one line per path
181N/A containing action, mode, ownership and age
181N/A fields:</para>
181N/A
99N/A <programlisting>Type Path Mode UID GID Age
59N/Ad /run/user 0755 root root 10d</programlisting>
12N/A
30N/A <refsect2>
26N/A <title>Type</title>
26N/A <variablelist>
26N/A <varlistentry>
2N/A <term><varname>f</varname></term>
26N/A <listitem><para>Create a file if it doesn't exist yet</para></listitem>
185N/A </varlistentry>
185N/A
185N/A <varlistentry>
2N/A <term><varname>F</varname></term>
255N/A <listitem><para>Create or truncate a file</para></listitem>
145N/A </varlistentry>
7N/A
26N/A <varlistentry>
26N/A <term><varname>d</varname></term>
38N/A <listitem><para>Create a directory if it doesn't exist yet</para></listitem>
26N/A </varlistentry>
197N/A
197N/A <varlistentry>
197N/A <term><varname>D</varname></term>
197N/A <listitem><para>Create or empty a directory</para></listitem>
197N/A </varlistentry>
26N/A
30N/A <varlistentry>
26N/A <term><varname>p</varname></term>
46N/A <listitem><para>Create a named pipe (FIFO) if it doesn't exist yet</para></listitem>
46N/A </varlistentry>
46N/A
64N/A <varlistentry>
64N/A <term><varname>x</varname></term>
26N/A <listitem><para>Ignore a path
46N/A during cleaning. Use this type
46N/A to exclude paths from clean-up
46N/A as controlled with the Age
2N/A parameter. Note that lines of
46N/A this type do not influence the
369N/A effect of r or R lines. Lines
53N/A of this type accept
46N/A shell-style globs in place of
46N/A of normal path
26N/A names.</para></listitem>
181N/A </varlistentry>
369N/A
181N/A <varlistentry>
181N/A <term><varname>r</varname></term>
181N/A <listitem><para>Remove a file
181N/A or directory if it
181N/A exists. This may not be used
181N/A to remove non-empty
76N/A directories, use R for
99N/A that. Lines of this type
181N/A accept shell-style globs in
99N/A place of normal path
26N/A names.</para></listitem>
185N/A </varlistentry>
185N/A
185N/A <varlistentry>
145N/A <term><varname>R</varname></term>
145N/A <listitem><para>Recursively
145N/A remove a path and all its
145N/A subdirectories (if it is a
145N/A directory). Lines of this type
117N/A accept shell-style globs in
84N/A place of normal path
145N/A names.</para></listitem>
145N/A </varlistentry>
145N/A
38N/A <varlistentry>
46N/A <term><varname>Z</varname></term>
99N/A <listitem><para>Recursively set
99N/A ownership, access mode and relabel
196N/A security context of a path and
185N/A all its subdirectories (if it is a
99N/A directory). Lines of this type accept
46N/A shell-style globs in place of normal
2N/A path names.</para></listitem>
145N/A </varlistentry>
26N/A </variablelist>
2N/A </refsect2>
32N/A
32N/A <refsect2>
32N/A <title>Mode</title>
32N/A
32N/A <para>The file access mode to use when
32N/A creating this file or directory. If omitted or
32N/A when set to - the default is used: 0755 for
32N/A directories, 0644 for files. For Z lines
32N/A if omitted or when set to - the file access mode will
32N/A not be modified. This parameter is ignored for x, r, R
38N/A lines.</para>
38N/A </refsect2>
38N/A
38N/A <refsect2>
38N/A <title>UID, GID</title>
38N/A
38N/A <para>The user and group to use for this file
38N/A or directory. This may either be a numeric
38N/A user/group ID or a user or group name. If
38N/A omitted or when set to - the default 0 (root)
145N/A is used. For Z lines when omitted or when set to -
38N/A the file ownership will not be modified.
38N/A These parameters are ignored for x, r, R lines.</para>
26N/A </refsect2>
26N/A
26N/A <refsect2>
26N/A <title>Age</title>
26N/A <para>The date field, when set, is used to
26N/A decide what files to delete when cleaning. If
26N/A a file or directory is older than the current
26N/A time minus the age field it is deleted. The
26N/A field format is a series of integers each
32N/A followed by one of the following
32N/A postfixes for the respective time units:</para>
32N/A
32N/A <variablelist>
32N/A <varlistentry>
32N/A <term><varname>s</varname></term>
32N/A <term><varname>min</varname></term>
32N/A <term><varname>h</varname></term>
38N/A <term><varname>d</varname></term>
38N/A <term><varname>w</varname></term>
38N/A <term><varname>ms</varname></term>
32N/A <term><varname>m</varname></term>
<term><varname>us</varname></term></varlistentry>
</variablelist>
<para>If multiple integers and units are specified the time
values are summed up.</para>
<para>The age field only applies to lines starting with
d, D and x. If omitted or set to - no automatic clean-up
is done.</para>
</refsect2>
</refsect1>
<refsect1>
<title>Example</title>
<example>
<title>/etc/tmpfiles.d/screen.conf example</title>
<para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para>
<programlisting>d /var/run/screens 1777 root root 10d
d /var/run/uscreens 0755 root root 10d12h</programlisting>
</example>
</refsect1>
<refsect1>
<title>See Also</title>
<para>
<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
<citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry>
</para>
</refsect1>
</refentry>