]>
Commit | Line | Data |
---|---|---|
4149f86d BP |
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> | |
522d4a49 LP |
45 | <refpurpose>Configuration for creation, deletion and |
46 | cleaning of volatile and temporary files</refpurpose> | |
4149f86d BP |
47 | </refnamediv> |
48 | ||
a7c64469 | 49 | <refsynopsisdiv> |
772f8371 | 50 | <para><filename>/usr/lib/tmpfiles.d/*.conf</filename></para> |
a7c64469 | 51 | <para><filename>/etc/tmpfiles.d/*.conf</filename></para> |
772f8371 | 52 | <para><filename>/run/tmpfiles.d/*.conf</filename></para> |
a7c64469 LP |
53 | </refsynopsisdiv> |
54 | ||
4149f86d BP |
55 | <refsect1> |
56 | <title>Description</title> | |
57 | ||
522d4a49 | 58 | <para><command>systemd-tmpfiles</command> uses the |
772f8371 | 59 | configuration files from the above directories to describe the |
522d4a49 LP |
60 | creation, cleaning and removal of volatile and |
61 | temporary files and directories which usually reside | |
bb29785e | 62 | in directories such as <filename>/run</filename> |
772f8371 | 63 | or <filename>/tmp</filename>.</para> |
4149f86d BP |
64 | </refsect1> |
65 | ||
66 | <refsect1> | |
67 | <title>Configuration Format</title> | |
68 | ||
772f8371 KS |
69 | <para>Each configuration file is named in the style of |
70 | <filename><program>.conf</filename>. | |
71 | Files in <filename>/etc/</filename> overwrite | |
72 | files with the same name in <filename>/usr/lib/</filename>. | |
73 | Files in <filename>/run</filename> overwrite files with | |
74 | the same name in <filename>/etc/</filename> and | |
75 | <filename>/usr/lib/</filename>. Packages should install their | |
76 | configuration files in <filename>/usr/lib/</filename>, files | |
77 | in <filename>/etc/</filename> are reserved for the local | |
78 | administration, which possibly decides to overwrite the | |
79 | configurations installed from packages. All files are sorted | |
80 | by filename in alphabetical order, regardless in which of the | |
81 | directories they reside, to ensure that a specific | |
82 | configuration file takes precedence over another file with | |
83 | an alphabetically later name.</para> | |
84 | ||
aeee2322 LP |
85 | <para>The configuration format is one line per path |
86 | containing action, mode, ownership and age | |
87 | fields:</para> | |
88 | ||
88aebb62 | 89 | <programlisting>Type Path Mode UID GID Age |
bb29785e | 90 | d /run/user 0755 root root 10d</programlisting> |
aeee2322 LP |
91 | |
92 | <refsect2> | |
88aebb62 | 93 | <title>Type</title> |
aeee2322 LP |
94 | <variablelist> |
95 | <varlistentry> | |
96 | <term><varname>f</varname></term> | |
a7c64469 | 97 | <listitem><para>Create a file if it doesn't exist yet</para></listitem> |
aeee2322 LP |
98 | </varlistentry> |
99 | ||
100 | <varlistentry> | |
101 | <term><varname>F</varname></term> | |
a7c64469 | 102 | <listitem><para>Create or truncate a file</para></listitem> |
aeee2322 LP |
103 | </varlistentry> |
104 | ||
105 | <varlistentry> | |
106 | <term><varname>d</varname></term> | |
a7c64469 | 107 | <listitem><para>Create a directory if it doesn't exist yet</para></listitem> |
aeee2322 LP |
108 | </varlistentry> |
109 | ||
110 | <varlistentry> | |
111 | <term><varname>D</varname></term> | |
a7c64469 | 112 | <listitem><para>Create or empty a directory</para></listitem> |
aeee2322 LP |
113 | </varlistentry> |
114 | ||
ee17ee7c LP |
115 | <varlistentry> |
116 | <term><varname>p</varname></term> | |
117 | <listitem><para>Create a named pipe (FIFO) if it doesn't exist yet</para></listitem> | |
118 | </varlistentry> | |
119 | ||
aeee2322 LP |
120 | <varlistentry> |
121 | <term><varname>x</varname></term> | |
b8bb3e8f LP |
122 | <listitem><para>Ignore a path |
123 | during cleaning. Use this type | |
124 | to exclude paths from clean-up | |
125 | as controlled with the Age | |
126 | parameter. Note that lines of | |
127 | this type do not influence the | |
128 | effect of r or R lines. Lines | |
129 | of this type accept | |
130 | shell-style globs in place of | |
131 | of normal path | |
132 | names.</para></listitem> | |
aeee2322 LP |
133 | </varlistentry> |
134 | ||
135 | <varlistentry> | |
136 | <term><varname>r</varname></term> | |
b8bb3e8f LP |
137 | <listitem><para>Remove a file |
138 | or directory if it | |
139 | exists. This may not be used | |
140 | to remove non-empty | |
141 | directories, use R for | |
142 | that. Lines of this type | |
143 | accept shell-style globs in | |
144 | place of normal path | |
145 | names.</para></listitem> | |
aeee2322 LP |
146 | </varlistentry> |
147 | ||
148 | <varlistentry> | |
149 | <term><varname>R</varname></term> | |
b8bb3e8f LP |
150 | <listitem><para>Recursively |
151 | remove a path and all its | |
152 | subdirectories (if it is a | |
153 | directory). Lines of this type | |
154 | accept shell-style globs in | |
155 | place of normal path | |
156 | names.</para></listitem> | |
aeee2322 | 157 | </varlistentry> |
462d63db MS |
158 | |
159 | <varlistentry> | |
160 | <term><varname>Z</varname></term> | |
161 | <listitem><para>Recursively | |
162 | relabel security context of a path and | |
163 | all its subdirectories (if it is a | |
164 | directory). Lines of this type accept | |
165 | shell-style globs in place of normal | |
166 | path names.</para></listitem> | |
167 | </varlistentry> | |
aeee2322 LP |
168 | </variablelist> |
169 | </refsect2> | |
170 | ||
171 | <refsect2> | |
88aebb62 LP |
172 | <title>Mode</title> |
173 | ||
b8bb3e8f LP |
174 | <para>The file access mode to use when |
175 | creating this file or directory. If omitted or | |
176 | when set to - the default is used: 0755 for | |
177 | directories, 0644 for files. This parameter is | |
178 | ignored for x, r, R lines.</para> | |
88aebb62 LP |
179 | </refsect2> |
180 | ||
181 | <refsect2> | |
182 | <title>UID, GID</title> | |
183 | ||
184 | <para>The user and group to use for this file | |
185 | or directory. This may either be a numeric | |
186 | user/group ID or a user or group name. If | |
b8bb3e8f LP |
187 | omitted or when set to - the default 0 (root) |
188 | is used. . These parameters are ignored for x, | |
189 | r, R lines.</para> | |
88aebb62 LP |
190 | </refsect2> |
191 | ||
192 | <refsect2> | |
193 | <title>Age</title> | |
aeee2322 LP |
194 | <para>The date field, when set, is used to |
195 | decide what files to delete when cleaning. If | |
196 | a file or directory is older than the current | |
197 | time minus the age field it is deleted. The | |
198 | field format is a series of integers each | |
199 | followed by one of the following | |
200 | postfixes for the respective time units:</para> | |
201 | ||
202 | <variablelist> | |
203 | <varlistentry> | |
204 | <term><varname>s</varname></term> | |
205 | <term><varname>min</varname></term> | |
206 | <term><varname>h</varname></term> | |
207 | <term><varname>d</varname></term> | |
208 | <term><varname>w</varname></term> | |
209 | <term><varname>ms</varname></term> | |
210 | <term><varname>m</varname></term> | |
211 | <term><varname>us</varname></term></varlistentry> | |
212 | </variablelist> | |
4149f86d | 213 | |
772f8371 KS |
214 | <para>If multiple integers and units are specified the time |
215 | values are summed up.</para> | |
4149f86d | 216 | |
772f8371 KS |
217 | <para>The age field only applies to lines starting with |
218 | d, D and x. If omitted or set to - no automatic clean-up | |
219 | is done.</para> | |
aeee2322 | 220 | </refsect2> |
4149f86d BP |
221 | |
222 | </refsect1> | |
223 | ||
224 | <refsect1> | |
225 | <title>Example</title> | |
226 | <example> | |
227 | <title>/etc/tmpfiles.d/screen.conf example</title> | |
228 | <para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para> | |
229 | ||
230 | <programlisting>d /var/run/screens 1777 root root 10d | |
aeee2322 | 231 | d /var/run/uscreens 0755 root root 10d12h</programlisting> |
4149f86d BP |
232 | </example> |
233 | </refsect1> | |
234 | ||
235 | <refsect1> | |
236 | <title>See Also</title> | |
237 | <para> | |
522d4a49 LP |
238 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, |
239 | <citerefentry><refentrytitle>systemd-tmpfiles</refentrytitle><manvolnum>8</manvolnum></citerefentry> | |
4149f86d BP |
240 | </para> |
241 | </refsect1> | |
242 | ||
243 | </refentry> |