chiark / gitweb /
man: reorder things to follow the same order everywhere
[elogind.git] / man / tmpfiles.d.xml
1 <?xml version="1.0"?>
2 <!--*-nxml-*-->
3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
4 <!--
5   This file is part of systemd.
6
7   Copyright 2010 Brandon Philips
8
9   systemd is free software; you can redistribute it and/or modify it
10   under the terms of the GNU General Public License as published by
11   the Free Software Foundation; either version 2 of the License, or
12   (at your option) any later version.
13
14   systemd is distributed in the hope that it will be useful, but
15   WITHOUT ANY WARRANTY; without even the implied warranty of
16   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17   General Public License for more details.
18
19   You should have received a copy of the GNU General Public License
20   along with systemd; If not, see <http://www.gnu.org/licenses/>.
21 -->
22 <refentry id="tmpfiles.d">
23
24         <refentryinfo>
25                 <title>tmpfiles.d</title>
26                 <productname>systemd</productname>
27
28                 <authorgroup>
29                         <author>
30                                 <contrib>Documentation</contrib>
31                                 <firstname>Brandon</firstname>
32                                 <surname>Philips</surname>
33                                 <email>brandon@ifup.org</email>
34                         </author>
35                 </authorgroup>
36         </refentryinfo>
37
38         <refmeta>
39                 <refentrytitle>tmpfiles.d</refentrytitle>
40                 <manvolnum>5</manvolnum>
41         </refmeta>
42
43         <refnamediv>
44                 <refname>tmpfiles.d</refname>
45                 <refpurpose>configuration for creation, deletion and cleaning of tmpfiles</refpurpose>
46         </refnamediv>
47
48         <refsect1>
49                 <title>Description</title>
50
51                 <para><command>systemd</command> uses
52                 <filename>/etc/tmpfiles.d/</filename> to describe the
53                 creation, cleaning and removal of temporary files and
54                 directories which usually reside in
55                 <filename>/var/run</filename> or
56                 <filename>/tmp</filename>).  Each configuration file
57                 is named in the style of
58                 <filename>/etc/tmpfiles.d/&lt;program&gt;.conf</filename></para>
59         </refsect1>
60
61         <refsect1>
62                 <title>Configuration Format</title>
63
64                 <para>The configuration format is one line per path
65                 containing action, mode, ownership and age
66                 fields:</para>
67
68                 <programlisting>Type Path          Mode UID  GID  Age
69 d    /var/run/user 0755 root root 10d</programlisting>
70
71                 <refsect2>
72                         <title>Type</title>
73                         <variablelist>
74                                 <varlistentry>
75                                         <term><varname>f</varname></term>
76                                         <listitem><para>create a file if it doesn't exist yet</para></listitem>
77                                 </varlistentry>
78
79                                 <varlistentry>
80                                         <term><varname>F</varname></term>
81                                         <listitem><para>create or truncate a file</para></listitem>
82                                 </varlistentry>
83
84                                 <varlistentry>
85                                         <term><varname>d</varname></term>
86                                         <listitem><para>create a directory if it doesn't exist yet</para></listitem>
87                                 </varlistentry>
88
89                                 <varlistentry>
90                                         <term><varname>D</varname></term>
91                                         <listitem><para>create or empty a directory</para></listitem>
92                                 </varlistentry>
93
94                                 <varlistentry>
95                                         <term><varname>x</varname></term>
96                                         <listitem><para>ignore a path</para></listitem>
97                                 </varlistentry>
98
99                                 <varlistentry>
100                                         <term><varname>r</varname></term>
101                                         <listitem><para>remove a path</para></listitem>
102                                 </varlistentry>
103
104                                 <varlistentry>
105                                         <term><varname>R</varname></term>
106                                         <listitem><para>recursively remove a path</para></listitem>
107                                 </varlistentry>
108                         </variablelist>
109                 </refsect2>
110
111                 <refsect2>
112                         <title>Mode</title>
113
114                         <para>The file access mode to use for this
115                         file or directory. If ommited or when set to -
116                         the default is used: 0755 for directories,
117                         0644 for files.</para>
118                 </refsect2>
119
120                 <refsect2>
121                         <title>UID, GID</title>
122
123                         <para>The user and group to use for this file
124                         or directory. This may either be a numeric
125                         user/group ID or a user or group name. If
126                         ommited or when set to - the default 0 is
127                         used.</para>
128                 </refsect2>
129
130                 <refsect2>
131                         <title>Age</title>
132                         <para>The date field, when set, is used to
133                         decide what files to delete when cleaning. If
134                         a file or directory is older than the current
135                         time minus the age field it is deleted. The
136                         field format is a series of integers each
137                         followed by one of the following
138                         postfixes for the respective time units:</para>
139
140                         <variablelist>
141                                 <varlistentry>
142                                 <term><varname>s</varname></term>
143                                 <term><varname>min</varname></term>
144                                 <term><varname>h</varname></term>
145                                 <term><varname>d</varname></term>
146                                 <term><varname>w</varname></term>
147                                 <term><varname>ms</varname></term>
148                                 <term><varname>m</varname></term>
149                                 <term><varname>us</varname></term></varlistentry>
150                         </variablelist>
151
152                         <para>If multiple integers and units are specified the time values are summed up.</para>
153
154                         <para>The age field only applies to lines starting with d, D and x. If ommited or set to - no automatic clean-up is done.</para>
155
156                 </refsect2>
157
158         </refsect1>
159
160         <refsect1>
161                 <title>Example</title>
162                 <example>
163                         <title>/etc/tmpfiles.d/screen.conf example</title>
164                         <para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para>
165
166                         <programlisting>d /var/run/screens 1777 root root 10d
167 d /var/run/uscreens 0755 root root 10d12h</programlisting>
168                 </example>
169         </refsect1>
170
171         <refsect1>
172                 <title>See Also</title>
173                 <para>
174                         <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>
175                 </para>
176         </refsect1>
177
178 </refentry>