tmpfile.d
also: systemd-tmpfiles, tmpfiles.d
A systemd configuration directory that defines temporary files and directories to be created, deleted, or cleaned up automatically at boot and during regular maintenance.
tmpfile.d is a systemd feature that manages volatile runtime data through configuration files placed in /etc/tmpfiles.d/, /run/tmpfiles.d/, and /usr/lib/tmpfiles.d/. The systemd-tmpfiles service reads these files and applies the rules they contain.
Each configuration file defines rules for creating, removing, or modifying temporary files and directories. Rules specify the path, type (file, directory, symlink, etc.), permissions, ownership, and age-based cleanup policies. For example, a rule might create /run/myapp as a directory with mode 755 owned by a specific user, or clean up files in /tmp older than 30 days.
This is commonly used by packages to ensure runtime directories exist at startup, set correct permissions, and automatically clean up stale temporary files without manual intervention. It replaces older init script-based directory creation and cleanup.