]>
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> | |
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 <filename>/etc/tmpfiles.d/</filename> to describe the creation, cleaning and removal of temporary files and directories | |
52 | which usually reside in <filename>/var/run</filename> or <filename>/tmp</filename>). | |
53 | Each configuration file is named in the style of | |
54 | <filename>/etc/tmpfiles.d/<program>.conf</filename></para> | |
55 | ||
56 | </refsect1> | |
57 | ||
58 | <refsect1> | |
59 | <title>Configuration Format</title> | |
60 | ||
61 | <para>The configuration format is one line per path containing | |
62 | action, mode, ownership and age fields:</para> | |
63 | ||
64 | <programlisting>type path mode uid gid age | |
65 | d /var/run/user 0755 root root 10d | |
66 | </programlisting> | |
67 | ||
68 | <refsect2> | |
69 | <title>type</title> | |
70 | <variablelist> | |
71 | <varlistentry> | |
72 | <term><varname>f</varname></term> | |
73 | <listitem><para>create a file</para></listitem> | |
74 | </varlistentry> | |
75 | ||
76 | <varlistentry> | |
77 | <term><varname>F</varname></term> | |
78 | <listitem><para>truncate a file</para></listitem> | |
79 | </varlistentry> | |
80 | ||
81 | <varlistentry> | |
82 | <term><varname>d</varname></term> | |
83 | <listitem><para>create a directory</para></listitem> | |
84 | </varlistentry> | |
85 | ||
86 | <varlistentry> | |
87 | <term><varname>D</varname></term> | |
88 | <listitem><para>truncate a directory</para></listitem> | |
89 | </varlistentry> | |
90 | ||
91 | <varlistentry> | |
92 | <term><varname>x</varname></term> | |
93 | <listitem><para>ignore the path</para></listitem> | |
94 | </varlistentry> | |
95 | ||
96 | <varlistentry> | |
97 | <term><varname>r</varname></term> | |
98 | <listitem><para>remove the path</para></listitem> | |
99 | </varlistentry> | |
100 | ||
101 | <varlistentry> | |
102 | <term><varname>R</varname></term> | |
103 | <listitem><para>recursively remove the path</para></listitem> | |
104 | </varlistentry> | |
105 | </variablelist> | |
106 | </refsect2> | |
107 | ||
108 | <refsect2> | |
109 | <title>age</title> | |
110 | <para>The date field, when set, is used to decide what files to delete when cleaning. If a file or directory is older than the current time minus the age field it is deleted. The field format is an integer followed by one of the following postfixes:</para> | |
111 | <variablelist> | |
112 | <varlistentry><term><varname>sec</varname></term> | |
113 | <term><varname>s</varname></term> | |
114 | <term><varname>min</varname></term> | |
115 | <term><varname>hr</varname></term> | |
116 | <term><varname>h</varname></term> | |
117 | <term><varname>d</varname></term> | |
118 | <term><varname>w</varname></term> | |
119 | <term><varname>msec</varname></term> | |
120 | <term><varname>ms</varname></term> | |
121 | <term><varname>m</varname></term> | |
122 | <term><varname>usec</varname></term> | |
123 | <term><varname>us</varname></term></varlistentry> | |
124 | </variablelist> | |
125 | </refsect2> | |
126 | ||
127 | ||
128 | </refsect1> | |
129 | ||
130 | <refsect1> | |
131 | <title>Example</title> | |
132 | <example> | |
133 | <title>/etc/tmpfiles.d/screen.conf example</title> | |
134 | <para><command>screen</command> needs two directories created at boot with specific modes and ownership.</para> | |
135 | ||
136 | <programlisting>d /var/run/screens 1777 root root 10d | |
137 | d /var/run/uscreens 0755 root root 10d | |
138 | </programlisting> | |
139 | </example> | |
140 | </refsect1> | |
141 | ||
142 | <refsect1> | |
143 | <title>See Also</title> | |
144 | <para> | |
145 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
146 | </para> | |
147 | </refsect1> | |
148 | ||
149 | </refentry> |