конфигурация для создания, удаления и очистки летучих и временных файлов (Configuration for creation, deletion and cleaning of volatile and temporary files)
Имя (Name)
tmpfiles.d - Configuration for creation, deletion and cleaning of
volatile and temporary files
Синопсис (Synopsis)
/etc/tmpfiles.d/*.conf
/run/tmpfiles.d/*.conf
/usr/lib/tmpfiles.d/*.conf
~/.config/user-tmpfiles.d/*.conf
$XDG_RUNTIME_DIR/user-tmpfiles.d/*.conf
~/.local/share/user-tmpfiles.d/*.conf
...
/usr/share/user-tmpfiles.d/*.conf
#Type Path Mode User Group Age Argument
f /file/to/create mode user group - content
f+ /file/to/create-or-truncate mode user group - content
w /file/to/write-to - - - - content
w+ /file/to/append-to - - - - content
d /directory/to/create-and-cleanup mode user group cleanup-age -
D /directory/to/create-and-remove mode user group cleanup-age -
e /directory/to/cleanup mode user group cleanup-age -
v /subvolume-or-directory/to/create mode user group - -
q /subvolume-or-directory/to/create mode user group - -
Q /subvolume-or-directory/to/create mode user group - -
p /fifo/to/create mode user group - -
p+ /fifo/to/[re]create mode user group - -
L /symlink/to/create - - - - symlink/target/path
L+ /symlink/to/[re]create - - - - symlink/target/path
c /dev/char-device-to-create mode user group - major:minor
c+ /dev/char-device-to-[re]create mode user group - major:minor
b /dev/block-device-to-create mode user group - major:minor
b+ /dev/block-device-to-[re]create mode user group - major:minor
C /target/to/create - - - - /source/to/copy
x /path-or-glob/to/ignore/recursively - - - - -
X /path-or-glob/to/ignore - - - - -
r /empty/dir/to/remove - - - - -
R /dir/to/remove/recursively - - - - -
z /path-or-glob/to/adjust/mode mode user group - -
Z /path-or-glob/to/adjust/mode/recursively mode user group - -
t /path-or-glob/to/set/xattrs - - - - xattrs
T /path-or-glob/to/set/xattrs/recursively - - - - xattrs
h /path-or-glob/to/set/attrs - - - - file attrs
H /path-or-glob/to/set/attrs/recursively - - - - file attrs
a /path-or-glob/to/set/acls - - - - POSIX ACLs
a+ /path-or-glob/to/append/acls - - - - POSIX ACLs
A /path-or-glob/to/set/acls/recursively - - - - POSIX ACLs
A+ /path-or-glob/to/append/acls/recursively - - - - POSIX ACLs
Описание (Description)
tmpfiles.d configuration files provide a generic mechanism to
define the creation of regular files, directories, pipes, and
device nodes, adjustments to their access mode, ownership,
attributes, quota assignments, and contents, and finally their
time-based removal. It is mostly commonly used for volatile and
temporary files and directories (such as those located under
/run/, /tmp/, /var/tmp/, the API file systems such as /sys/ or
/proc/, as well as some other directories below /var/).
systemd-tmpfiles
uses this configuration to create volatile files
and directories during boot and to do periodic cleanup
afterwards. See systemd-tmpfiles
(5) for the description of
systemd-tmpfiles-setup.service, systemd-tmpfiles-clean.service,
and associated units.
System daemons frequently require private runtime directories
below /run/ to store communication sockets and similar. For
these, it is better to use RuntimeDirectory= in their unit files
(see systemd.exec(5) for details), if the flexibility provided by
tmpfiles.d is not required. The advantages are that the
configuration required by the unit is centralized in one place,
and that the lifetime of the directory is tied to the lifetime of
the service itself. Similarly, StateDirectory=, CacheDirectory=,
LogsDirectory=, and ConfigurationDirectory= should be used to
create directories under /var/lib/, /var/cache/, /var/log/, and
/etc/. tmpfiles.d should be used for files whose lifetime is
independent of any service or requires more complicated
configuration.