Systemd-tmpfiles: Difference between revisions
No edit summary |
No edit summary |
||
Line 4: | Line 4: | ||
====RHEL 7, 8, and other Red Hat Derivatives==== | ====RHEL 7, 8, and other Red Hat Derivatives==== | ||
---- | ---- | ||
On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at: | On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at: | ||
Line 14: | Line 12: | ||
This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer. | This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer. | ||
The configuration file: <b>/usr/lib/tmpfiles.d/tmp.conf</b> is called by <b>systemd-tmpfiles-clean.service</b> |
Latest revision as of 00:42, 27 August 2025
Systemd-tmpfiles is a component of the systemd suite that manages volatile and temporary files and directories by creating, cleaning, and deleting them based on configuration files found in /etc/tmpfiles.d, /run/tmpfiles.d, and /usr/lib/tmpfiles.d. It uses configuration files with a specific format to define actions for different paths, ensuring that temporary data does not accumulate and consume unnecessary storage space.
RHEL 7, 8, and other Red Hat Derivatives
On Red Hat Enterprise Linux (RHEL) 7 and later, the cleanup of the /tmp directory is managed by systemd-tmpfiles. The configuration file responsible for defining the cleanup parameters for /tmp is located at:
/usr/lib/tmpfiles.d/tmp.conf
Within this file, the v directive specifies the path to be cleaned, along with permissions, ownership, and the retention period. For example, a common entry for /tmp would resemble:
v /tmp 1777 root root 10d
This line indicates that files and directories within /tmp older than 10 days are subject to deletion during the systemd-tmpfiles --clean operation, which is typically executed periodically by a systemd timer.
The configuration file: /usr/lib/tmpfiles.d/tmp.conf is called by systemd-tmpfiles-clean.service