tmpfiles.d
systemd
Documentation
Brandon
Philips
brandon@ifup.org
tmpfiles.d
5
tmpfiles.d
configuration for creation, deletion and cleaning of tmpfiles
Description
systemd uses /etc/tmpfiles.d/ to describe the creation, cleaning and removal of temporary files and directories
which usually reside in /var/run or /tmp).
Each configuration file is named in the style of
/etc/tmpfiles.d/<program>.conf
Configuration Format
The configuration format is one line per path containing
action, mode, ownership and age fields:
type path mode uid gid age
d /var/run/user 0755 root root 10d
type
f
create a file
F
truncate a file
d
create a directory
D
truncate a directory
x
ignore the path
r
remove the path
R
recursively remove the path
age
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:
sec
s
min
hr
h
d
w
msec
ms
m
usec
us
Example
/etc/tmpfiles.d/screen.conf example
screen needs two directories created at boot with specific modes and ownership.
d /var/run/screens 1777 root root 10d
d /var/run/uscreens 0755 root root 10d
See Also
systemd1