~ubuntu-branches/ubuntu/trusty/systemd/trusty

« back to all changes in this revision

Viewing changes to man/tmpfiles.d.5

Tags: upstream-202
ImportĀ upstreamĀ versionĀ 202

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
'\" t
2
 
.\"     Title: tmpfiles.d
3
 
.\"    Author: Brandon Philips <brandon@ifup.org>
4
 
.\" Generator: DocBook XSL Stylesheets v1.77.1 <http://docbook.sf.net/>
5
 
.\"      Date: 03/07/2013
6
 
.\"    Manual: tmpfiles.d
7
 
.\"    Source: systemd
8
 
.\"  Language: English
9
 
.\"
10
 
.TH "TMPFILES\&.D" "5" "" "systemd" "tmpfiles.d"
11
 
.\" -----------------------------------------------------------------
12
 
.\" * Define some portability stuff
13
 
.\" -----------------------------------------------------------------
14
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15
 
.\" http://bugs.debian.org/507673
16
 
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17
 
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18
 
.ie \n(.g .ds Aq \(aq
19
 
.el       .ds Aq '
20
 
.\" -----------------------------------------------------------------
21
 
.\" * set default formatting
22
 
.\" -----------------------------------------------------------------
23
 
.\" disable hyphenation
24
 
.nh
25
 
.\" disable justification (adjust text to left margin only)
26
 
.ad l
27
 
.\" -----------------------------------------------------------------
28
 
.\" * MAIN CONTENT STARTS HERE *
29
 
.\" -----------------------------------------------------------------
30
 
.SH "NAME"
31
 
tmpfiles.d \- Configuration for creation, deletion and cleaning of volatile and temporary files
32
 
.SH "SYNOPSIS"
33
 
.PP
34
 
/etc/tmpfiles\&.d/*\&.conf
35
 
.PP
36
 
/run/tmpfiles\&.d/*\&.conf
37
 
.PP
38
 
/usr/lib/tmpfiles\&.d/*\&.conf
39
 
.SH "DESCRIPTION"
40
 
.PP
41
 
\fBsystemd\-tmpfiles\fR
42
 
uses the configuration files from the above directories to describe the creation, cleaning and removal of volatile and temporary files and directories which usually reside in directories such as
43
 
/run
44
 
or
45
 
/tmp\&.
46
 
.SH "CONFIGURATION FORMAT"
47
 
.PP
48
 
Each configuration file shall be named in the style of
49
 
<program>\&.conf\&. Files in
50
 
/etc/
51
 
override files with the same name in
52
 
/usr/lib/
53
 
and
54
 
/run/\&. Files in
55
 
/run/
56
 
override files with the same name in
57
 
/usr/lib/\&. Packages should install their configuration files in
58
 
/usr/lib/\&. Files in
59
 
/etc/
60
 
are reserved for the local administrator, who may use this logic to override the configuration files installed by vendor packages\&. All configuration files are sorted by their filename in alphabetical order, regardless in which of the directories they reside, to guarantee that a specific configuration file takes precedence over another file with an alphabetically later name\&.
61
 
.PP
62
 
If the administrator wants to disable a configuration file supplied by the vendor the recommended way is to place a symlink to
63
 
/dev/null
64
 
in
65
 
/etc/tmpfiles\&.d/
66
 
bearing the same file name\&.
67
 
.PP
68
 
The configuration format is one line per path containing action, path, mode, ownership, age and argument fields:
69
 
.sp
70
 
.if n \{\
71
 
.RS 4
72
 
.\}
73
 
.nf
74
 
Type Path        Mode UID  GID  Age Argument
75
 
d    /run/user   0755 root root 10d \-
76
 
L    /tmp/foobar \-    \-    \-    \-   /dev/null
77
 
.fi
78
 
.if n \{\
79
 
.RE
80
 
.\}
81
 
.SS "Type"
82
 
.PP
83
 
\fIf\fR
84
 
.RS 4
85
 
Create a file if it doesn\*(Aqt exist yet (optionally writing a short string into it, if the argument parameter is passed)
86
 
.RE
87
 
.PP
88
 
\fIF\fR
89
 
.RS 4
90
 
Create or truncate a file (optionally writing a short string into it, if the argument parameter is passed)
91
 
.RE
92
 
.PP
93
 
\fIw\fR
94
 
.RS 4
95
 
Write the argument parameter to a file, if the file exists\&. Lines of this type accept shell\-style globs in place of normal path names\&. The argument parameter will be written without a trailing newline\&. C\-style backslash escapes are interpreted\&.
96
 
.RE
97
 
.PP
98
 
\fId\fR
99
 
.RS 4
100
 
Create a directory if it doesn\*(Aqt exist yet
101
 
.RE
102
 
.PP
103
 
\fID\fR
104
 
.RS 4
105
 
Create or empty a directory
106
 
.RE
107
 
.PP
108
 
\fIp\fR
109
 
.RS 4
110
 
Create a named pipe (FIFO) if it doesn\*(Aqt exist yet
111
 
.RE
112
 
.PP
113
 
\fIL\fR
114
 
.RS 4
115
 
Create a symlink if it doesn\*(Aqt exist yet
116
 
.RE
117
 
.PP
118
 
\fIc\fR
119
 
.RS 4
120
 
Create a character device node if it doesn\*(Aqt exist yet
121
 
.RE
122
 
.PP
123
 
\fIb\fR
124
 
.RS 4
125
 
Create a block device node if it doesn\*(Aqt exist yet
126
 
.RE
127
 
.PP
128
 
\fIx\fR
129
 
.RS 4
130
 
Ignore a path during cleaning\&. Use this type to exclude paths from clean\-up as controlled with the Age parameter\&. Note that lines of this type do not influence the effect of r or R lines\&. Lines of this type accept shell\-style globs in place of normal path names\&.
131
 
.RE
132
 
.PP
133
 
\fIX\fR
134
 
.RS 4
135
 
Ignore a path during cleanup\&. Use this type to prevent path removal as controlled with the Age parameter\&. Note that if path is a directory, content of a directory is not excluded from clean\-up, only directory itself\&. Lines of this type accept shell\-style globs in place of normal path names\&.
136
 
.RE
137
 
.PP
138
 
\fIr\fR
139
 
.RS 4
140
 
Remove a file or directory if it exists\&. This may not be used to remove non\-empty directories, use R for that\&. Lines of this type accept shell\-style globs in place of normal path names\&.
141
 
.RE
142
 
.PP
143
 
\fIR\fR
144
 
.RS 4
145
 
Recursively remove a path and all its subdirectories (if it is a directory)\&. Lines of this type accept shell\-style globs in place of normal path names\&.
146
 
.RE
147
 
.PP
148
 
\fIz\fR
149
 
.RS 4
150
 
Restore SELinux security context label and set ownership and access mode of a file or directory if it exists\&. Lines of this type accept shell\-style globs in place of normal path names\&.
151
 
.RE
152
 
.PP
153
 
\fIZ\fR
154
 
.RS 4
155
 
Recursively restore SELinux security context label and set ownership and access mode of a path and all its subdirectories (if it is a directory)\&. Lines of this type accept shell\-style globs in place of normal path names\&.
156
 
.RE
157
 
.SS "Mode"
158
 
.PP
159
 
The file access mode to use when creating this file or directory\&. If omitted or when set to \- the default is used: 0755 for directories, 0644 for all other file objects\&. For z, Z lines if omitted or when set to \- the file access mode will not be modified\&. This parameter is ignored for x, r, R, L lines\&.
160
 
.SS "UID, GID"
161
 
.PP
162
 
The user and group to use for this file or directory\&. This may either be a numeric user/group ID or a user or group name\&. If omitted or when set to \- the default 0 (root) is used\&. For z, Z lines when omitted or when set to \- the file ownership will not be modified\&. These parameters are ignored for x, r, R, L lines\&.
163
 
.SS "Age"
164
 
.PP
165
 
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 a series of integers each followed by one of the following postfixes for the respective time units:
166
 
.PP
167
 
\fIs\fR, \fImin\fR, \fIh\fR, \fId\fR, \fIw\fR, \fIms\fR, \fIm\fR, \fIus\fR
168
 
.RS 4
169
 
.RE
170
 
.PP
171
 
If multiple integers and units are specified the time values are summed up\&. If an integer is given without a unit, s is assumed\&.
172
 
.PP
173
 
When the age is set to zero, the files are cleaned unconditionally\&.
174
 
.PP
175
 
The age field only applies to lines starting with d, D and x\&. If omitted or set to \- no automatic clean\-up is done\&.
176
 
.PP
177
 
If the age field starts with a tilde character (~) the clean\-up is only applied to files and directories one level inside the directory specified, but not the files and directories immediately inside it\&.
178
 
.SS "Argument"
179
 
.PP
180
 
For L lines determines the destination path of the symlink\&. For c, b determines the major/minor of the device node, with major and minor formatted as integers, separated by :, e\&.g\&. "1:3"\&. For f, F, w may be used to specify a short string that is written to the file, suffixed by a newline\&. Ignored for all other lines\&.
181
 
.SH "EXAMPLE"
182
 
.PP
183
 
\fBExample\ \&1.\ \&/etc/tmpfiles.d/screen.conf example\fR
184
 
.PP
185
 
\fBscreen\fR
186
 
needs two directories created at boot with specific modes and ownership\&.
187
 
.sp
188
 
.if n \{\
189
 
.RS 4
190
 
.\}
191
 
.nf
192
 
d /var/run/screens  1777 root root 10d
193
 
d /var/run/uscreens 0755 root root 10d12h
194
 
.fi
195
 
.if n \{\
196
 
.RE
197
 
.\}
198
 
.SH "SEE ALSO"
199
 
.PP
200
 
 
201
 
\fBsystemd\fR(1),
202
 
\fBsystemd-tmpfiles\fR(8),
203
 
\fBsystemd-delta\fR(1)