]>
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> | |
a7c64469 | 45 | <refpurpose>Configuration for creation, deletion and cleaning of temporary and volatile files</refpurpose> |
4149f86d BP |
46 | </refnamediv> |
47 | ||
a7c64469 LP |
48 | <refsynopsisdiv> |
49 | <para><filename>/etc/tmpfiles.d/*.conf</filename></para> | |
50 | </refsynopsisdiv> | |
51 | ||
4149f86d BP |
52 | <refsect1> |
53 | <title>Description</title> | |
54 | ||
aeee2322 LP |
55 | <para><command>systemd</command> uses |
56 | <filename>/etc/tmpfiles.d/</filename> to describe the | |
57 | creation, cleaning and removal of temporary files and | |
58 | directories which usually reside in | |
59 | <filename>/var/run</filename> or | |
60 | <filename>/tmp</filename>). Each configuration file | |
61 | is named in the style of | |
a7c64469 | 62 | <filename>/etc/tmpfiles.d/<program>.conf</filename>.</para> |
4149f86d BP |
63 | </refsect1> |
64 | ||
65 | <refsect1> | |
66 | <title>Configuration Format</title> | |
67 | ||
aeee2322 LP |
68 | <para>The configuration format is one line per path |
69 | containing action, mode, ownership and age | |
70 | fields:</para> | |
71 | ||
88aebb62 | 72 | <programlisting>Type Path Mode UID GID Age |
aeee2322 LP |
73 | d /var/run/user 0755 root root 10d</programlisting> |
74 | ||
75 | <refsect2> | |
88aebb62 | 76 | <title>Type</title> |
aeee2322 LP |
77 | <variablelist> |
78 | <varlistentry> | |
79 | <term><varname>f</varname></term> | |
a7c64469 | 80 | <listitem><para>Create a file if it doesn't exist yet</para></listitem> |
aeee2322 LP |
81 | </varlistentry> |
82 | ||
83 | <varlistentry> | |
84 | <term><varname>F</varname></term> | |
a7c64469 | 85 | <listitem><para>Create or truncate a file</para></listitem> |
aeee2322 LP |
86 | </varlistentry> |
87 | ||
88 | <varlistentry> | |
89 | <term><varname>d</varname></term> | |
a7c64469 | 90 | <listitem><para>Create a directory if it doesn't exist yet</para></listitem> |
aeee2322 LP |
91 | </varlistentry> |
92 | ||
93 | <varlistentry> | |
94 | <term><varname>D</varname></term> | |
a7c64469 | 95 | <listitem><para>Create or empty a directory</para></listitem> |
aeee2322 LP |
96 | </varlistentry> |
97 | ||
98 | <varlistentry> | |
99 | <term><varname>x</varname></term> | |
a7c64469 | 100 | <listitem><para>Ignore a path</para></listitem> |
aeee2322 LP |
101 | </varlistentry> |
102 | ||
103 | <varlistentry> | |
104 | <term><varname>r</varname></term> | |
a7c64469 | 105 | <listitem><para>Remove a path</para></listitem> |
aeee2322 LP |
106 | </varlistentry> |
107 | ||
108 | <varlistentry> | |
109 | <term><varname>R</varname></term> | |
a7c64469 | 110 | <listitem><para>Recursively remove a path</para></listitem> |
aeee2322 LP |
111 | </varlistentry> |
112 | </variablelist> | |
113 | </refsect2> | |
114 | ||
115 | <refsect2> | |
88aebb62 LP |
116 | <title>Mode</title> |
117 | ||
118 | <para>The file access mode to use for this | |
119 | file or directory. If ommited or when set to - | |
120 | the default is used: 0755 for directories, | |
121 | 0644 for files.</para> | |
122 | </refsect2> | |
123 | ||
124 | <refsect2> | |
125 | <title>UID, GID</title> | |
126 | ||
127 | <para>The user and group to use for this file | |
128 | or directory. This may either be a numeric | |
129 | user/group ID or a user or group name. If | |
130 | ommited or when set to - the default 0 is | |
131 | used.</para> | |
132 | </refsect2> | |
133 | ||
134 | <refsect2> | |
135 | <title>Age</title> | |
aeee2322 LP |
136 | <para>The date field, when set, is used to |
137 | decide what files to delete when cleaning. If | |
138 | a file or directory is older than the current | |
139 | time minus the age field it is deleted. The | |
140 | field format is a series of integers each | |
141 | followed by one of the following | |
142 | postfixes for the respective time units:</para> | |
143 | ||
144 | <variablelist> | |
145 | <varlistentry> | |
146 | <term><varname>s</varname></term> | |
147 | <term><varname>min</varname></term> | |
148 | <term><varname>h</varname></term> | |
149 | <term><varname>d</varname></term> | |
150 | <term><varname>w</varname></term> | |
151 | <term><varname>ms</varname></term> | |
152 | <term><varname>m</varname></term> | |
153 | <term><varname>us</varname></term></varlistentry> | |
154 | </variablelist> | |
4149f86d | 155 | |
aeee2322 | 156 | <para>If multiple integers and units are specified the time values are summed up.</para> |
4149f86d | 157 | |
aeee2322 | 158 | <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> |
4149f86d | 159 | |
aeee2322 | 160 | </refsect2> |
4149f86d BP |
161 | |
162 | </refsect1> | |
163 | ||
164 | <refsect1> | |
165 | <title>Example</title> | |
166 | <example> | |
167 | <title>/etc/tmpfiles.d/screen.conf example</title> | |
168 | <para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para> | |
169 | ||
170 | <programlisting>d /var/run/screens 1777 root root 10d | |
aeee2322 | 171 | d /var/run/uscreens 0755 root root 10d12h</programlisting> |
4149f86d BP |
172 | </example> |
173 | </refsect1> | |
174 | ||
175 | <refsect1> | |
176 | <title>See Also</title> | |
177 | <para> | |
178 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
179 | </para> | |
180 | </refsect1> | |
181 | ||
182 | </refentry> |