2 .TH "TMPFILES\&.D" "5" "" "systemd 214" "tmpfiles.d"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
17 .\" disable justification (adjust text to left margin only)
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
23 tmpfiles.d \- Configuration for creation, deletion and cleaning of volatile and temporary files
26 /etc/tmpfiles\&.d/*\&.conf
28 /run/tmpfiles\&.d/*\&.conf
30 /usr/lib/tmpfiles\&.d/*\&.conf
33 \fBsystemd\-tmpfiles\fR
34 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
39 Volatile and temporary files and directories are those located in
44 /var/tmp, the API file systems such as
47 /proc, as well as some other directories below
50 System daemons frequently require private runtime directories below
52 to place communication sockets and similar in\&. For these, consider declaring them in their unit files using
53 \fIRuntimeDirectory=\fR
56 for details), if this is feasible\&.
57 .SH "CONFIGURATION FORMAT"
59 Each configuration file shall be named in the style of
62 \fIpackage\fR\-\fIpart\fR\&.conf\&. The second variant should be used when it is desirable to make it easy to override just this part of configuration\&.
66 override files with the same name in
69 /run/tmpfiles\&.d\&. Files in
71 override files with the same name in
72 /usr/lib/tmpfiles\&.d\&. Packages should install their configuration files in
73 /usr/lib/tmpfiles\&.d\&. Files in
75 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 lexicographic order, regardless of which of the directories they reside in\&. If multiple files specify the same path, the entry in the file with the lexicographically earliest name will be applied, all all other conflicting entries will be logged as errors\&. When two lines are prefix and suffix of each other, then the prefix is always processed first, the suffix later\&. Otherwise the files/directories are processed in the order they are listed\&.
77 If the administrator wants to disable a configuration file supplied by the vendor, the recommended way is to place a symlink to
81 bearing the same filename\&.
83 The configuration format is one line per path containing type, path, mode, ownership, age, and argument fields:
89 #Type Path Mode UID GID Age Argument
90 d /run/user 0755 root root 10d \-
91 L /tmp/foobar \- \- \- \- /dev/null
98 The type consists of a single letter and optionally an exclamation mark\&.
100 The following line types are understood:
104 Create a file if it does not exist yet\&. If the argument parameter is given, it will be written to the file\&.
109 Create or truncate a file\&. If the argument parameter is given, it will be written to the file\&.
114 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\&.
119 Create a directory if it does not exist yet\&.
124 Create or empty a directory\&.
129 Create a named pipe (FIFO) if it does not exist yet\&.
134 Create a symlink if it does not exist yet\&.
139 Create a character device node if it does not exist yet\&.
144 Create a block device node if it does not exist yet\&.
149 Recursively copy a file or directory, if the destination files or directories don\*(Aqt exist yet\&.
154 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
158 lines\&. Lines of this type accept shell\-style globs in place of normal path names\&.
163 Ignore a path during cleaning\&. Use this type to exclude paths from clean\-up as controlled with the Age parameter\&. Unlike
164 \fIx\fR, this parameter will not exclude the content if path is a directory, but only directory itself\&. Note that lines of this type do not influence the effect of
168 lines\&. Lines of this type accept shell\-style globs in place of normal path names\&.
173 Remove a file or directory if it exists\&. This may not be used to remove non\-empty directories, use
175 for that\&. Lines of this type accept shell\-style globs in place of normal path names\&.
180 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\&.
185 Adjust the access mode, group and user, and restore the SELinux security context of a file or directory, if it exists\&. Lines of this type accept shell\-style globs in place of normal path names\&.
190 Recursively set the access mode, group and user, and restore the SELinux security context of a file or directory if it exists, as well as of its subdirectories and the files contained therein (if applicable)\&. Lines of this type accept shell\-style globs in place of normal path names\&.
193 If the exclamation mark is used, this line is only safe of execute during boot, and can break a running system\&. Lines without the exclamation mark are presumed to be safe to execute at any time, e\&.g\&. on package upgrades\&.
194 \fBsystemd\-tmpfiles\fR
195 will execute line with an exclamation mark only if option
205 # Make sure these are created by default so that nobody else can
206 d /tmp/\&.X11\-unix 1777 root root 10d
208 # Unlink the X11 lock files
209 r! /tmp/\&.X[0\-9]*\-lock
215 The second line in contrast to the first one would break a running system, and will only be executed with
219 The file system path specification supports simple specifier expansion\&. The following expansions are understood:
222 .nr an-no-space-flag 1
225 .B Table\ \&1.\ \&Specifiers available
247 The machine ID of the running system, formatted as string\&. See \fBmachine-id\fR(5) for more information\&.
254 The boot ID of the running system, formatted as string\&. See \fBrandom\fR(4) for more information\&.
261 The hostname of the running system\&.
268 Identical to \fBuname \-r\fR output\&.
275 Single percent sign\&.
281 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
284 lines, if omitted or when set to
285 "\-", the file access mode will not be modified\&. This parameter is ignored for
292 Optionally, if prefixed with
294 the access mode is masked based on the already set access bits for existing file or directories: if the existing file has all executable bits unset then all executable bits are removed from the new access mode, too\&. Similar, if all read bits are removed from the old access mode they will be removed from the new access mode too, and if all write bits are removed, they will be removed from the new access mode too\&. In addition the sticky/suid/gid bit is removed unless applied to a directory\&. This functionality is particularly useful in conjunction with
298 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
299 "\-", the default 0 (root) is used\&. For
302 lines, when omitted or when set to \-, the file ownership will not be modified\&. These parameters are ignored for
310 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:
312 \fIs\fR, \fImin\fR, \fIh\fR, \fId\fR, \fIw\fR, \fIms\fR, \fIm\fR, \fIus\fR
316 If multiple integers and units are specified, the time values are summed up\&. If an integer is given without a unit, s is assumed\&.
318 When the age is set to zero, the files are cleaned unconditionally\&.
320 The age field only applies to lines starting with
323 \fIx\fR\&. If omitted or set to
324 "\-", no automatic clean\-up is done\&.
326 If the age field starts with a tilde character
327 "~", 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\&.
332 lines determines the destination path of the symlink\&. For
335 determines the major/minor of the device node, with major and minor formatted as integers, separated by
341 may be used to specify a short string that is written to the file, suffixed by a newline\&. For
343 specifies the source file or directory\&. Ignored for all other lines\&.
346 \fBExample\ \&1.\ \&/etc/tmpfiles.d/screen.conf example\fR
349 needs two directories created at boot with specific modes and ownership\&.
355 d /run/screens 1777 root root 10d
356 d /run/uscreens 0755 root root 10d12h
362 \fBExample\ \&2.\ \&/etc/tmpfiles.d/abrt.conf example\fR
365 needs a directory created at boot with specific mode and ownership and its content should be preserved\&.
371 d /var/tmp/abrt 0755 abrt abrt
380 \fBsystemd-tmpfiles\fR(8),
381 \fBsystemd-delta\fR(1),
382 \fBsystemd.exec\fR(5)