What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Use systemd-tmpfiles rules when you need systemd to create, set attributes on, or clean up paths such as /run/example-app and entries under /tmp. A rule describes the filesystem state; the distinct --create, --clean, and --remove operations determine what happens when it is applied. Because /run is volatile, paths there that must exist after a reboot need a suitable creation mechanism.
When systemd-tmpfiles is the right tool
systemd-tmpfiles creates, deletes, and cleans files and directories using the configuration format and locations defined by tmpfiles.d(5). System units invoke it for filesystem setup and system-wide cleanup; the tool itself only performs actions when invoked with the relevant operation. The systemd project’s systemd-tmpfiles manual describes its purpose this way.
This is useful for declaring repeatable ownership, permissions, creation, or age-based cleanup for paths. A comment in the systemd implementation source says the feature is intended to create properly owned directories beneath volatile /tmp, /var/tmp, and /run so they can be recreated on boot; that is an implementation comment, not a guarantee that any particular application path is configured on every Linux system. See systemd’s tmpfiles.c source.
Do not treat tmpfiles as a replacement for mount configuration, a service’s lifecycle management, or application logic for persistent state. If a directory is needed only while a particular service runs, a service-manager runtime-directory directive or application-managed setup may be a better fit. The right choice depends on when the path must exist, who owns it, and how it should be removed.
Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →#1 Best Overall
How to write a tmpfiles.d rule
A rule generally has one line per path, with fields for type, path, mode, user, group, age, and any argument:
#Type Path Mode User Group Age Argument...
The documented format permits C-style escapes; fields other than the argument may be quoted. Whitespace after the start of the argument belongs to the argument. Use a dash for a field that does not apply, including the argument when the rule has no argument. Full syntax and rule types are documented in tmpfiles.d(5).
Documented syntax examples
d /run/user 0755 root root 10d -
L /tmp/foobar - - - - /dev/null
The first line is the manual’s directory-rule example and includes a 10-day age field; it is not a recommendation to impose that age on every system. The second is a symlink rule. Consult the rule-type definitions in the manual before adapting either example.
Illustrative application directory
# /etc/tmpfiles.d/example-app.conf
d /run/example-app 0750 example example - -
This illustrative rule declares a directory at /run/example-app, intended to have mode 0750 and owner and group example. Put administrator-managed system rules in /etc/tmpfiles.d/. The named user and group must exist when the rule is applied. The example demonstrates documented syntax; it is not a claim that a distribution installs this file or account.
Choose the operation that matches the task
| Operation | Purpose | Practical use |
|---|---|---|
--create |
Creates or writes entries and applies ownership, mode, and related settings for applicable rule types. | Set up declared paths, including runtime directories that need to be recreated. |
--clean |
Processes entries with an age parameter. | Apply configured age-based cleanup; this is not a universal instruction to empty /tmp. |
--remove |
Removes entries marked for removal, subject to documented lock behavior. | Perform the removal work declared by applicable rules. |
These operations are not interchangeable. A rule’s presence does not by itself mean it runs immediately, and running one operation does not imply that the other two have run.
How to create a directory under /run at boot
- Create a system rule, for example
/etc/tmpfiles.d/example-app.conf, with a directory rule such asd /run/example-app 0750 example example - -. Confirm the user and group exist and choose permissions appropriate to the application. - Check the installed tmpfiles.d(5) manual and systemd unit configuration to understand which setup operation applies the rule on your distribution. Systemd provides setup and cleanup units, but their exact behavior and ordering are version- and distribution-dependent.
- If you need to apply the rule immediately, use the appropriate
systemd-tmpfiles --createinvocation after reviewing the applicable rules. For a new systemd version with dry-run support, first preview it as described below. - Verify that the resulting path has the intended owner, group, and mode. Since
/runis volatile, confirm that the relevant setup mechanism will recreate the path after reboot rather than relying on a one-time manual creation.
Do not assume that restarting a cleanup service reruns every setup action. The systemd manual notes that changes safe to execute at runtime can be reapplied by restarting systemd-tmpfiles-clean.service; inspect the local service configuration and manual first. Boot-only actions and rules tied to a different operation are not necessarily repeated by that restart.
How to test a rule without changing files
On systemd version 256 and later, --dry-run can show intended operations without modifying the filesystem. Check systemd-tmpfiles --help or the local manual first: older installations may not support this option.
systemd-tmpfiles --create --dry-run
To limit which rule paths are considered, the utility also supports --prefix=/run/example-app; --exclude-prefix can exclude rules under a specified prefix. These are path-selection controls, not a substitute for reading the rules they select or exclude. Check the installed systemd-tmpfiles manual for exact option syntax and availability before relying on them.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Review the proposed actions and the matching configuration before running a modifying operation. Be especially careful with broad cleanup or removal: the systemd manual describes system-wide --purge as usually not the desired command and recommends pairing it with dry-run first. Do not run cleanup against broad paths without understanding the applicable rules and age behavior.
Rank #4
How /tmp cleanup works—and why its age varies
Cleanup depends on rules with age fields and invocation of --clean. There is no single retention age or timer cadence that applies to all Linux distributions. Installed defaults, local overrides, systemd version, and timer or service configuration on the target machine determine what is cleaned and when.
- Read the active system and user tmpfiles configuration locations described by the local tmpfiles.d(5) manual.
- Inspect the relevant cleanup service and timer configuration on that host to establish when cleanup runs.
- Review the age fields and rule types affecting the paths you care about before invoking
--clean.
A user-level tmpfiles configuration does not shield files in shared /tmp from system-wide cleanup. The system instance performs global cleanup, and its rules can affect files created by user processes.
System rules, user rules, and precedence
System services use system-wide configuration, while user services use a distinct configuration set that can include user-controlled locations such as ~/.config/user-tmpfiles.d/ and ~/.local/share/user-tmpfiles.d/, as well as administrator-provided user rules. Available directories, precedence, and details have evolved over systemd versions. Use the tmpfiles.d(5) manual matching your installed systemd version instead of relying on precedence instructions written for another distribution or release.
Best Value
- New
- Mint Condition
- Dispatch same day for order received before 12 noon
- Guaranteed packaging
- No quibbles returns
Keep the distinction in mind when setting policy: user configuration applies to the user instance’s rules; system-wide cleanup of shared paths such as /tmp remains a system-level action.
Choosing between tmpfiles, service setup, and application logic
| Approach | Lifecycle fit | Ownership and cleanup considerations |
|---|---|---|
| systemd-tmpfiles | Declarative filesystem setup or cleanup when the corresponding operation is invoked, including system setup and age-based cleanup. | System and user instances have separate configuration scopes; age fields govern cleanup behavior where applicable. |
| Service-manager runtime-directory configuration | Potentially suitable when a directory should follow a particular service’s lifecycle. | Use when service-specific ownership or lifecycle is the requirement; consult that service manager’s documentation for exact behavior. |
| Application logic or explicit service setup | Suitable when creation depends on application-specific startup conditions or state. | The application or service must manage the needed permissions and removal behavior. |
There is no universal winner for every runtime path. Choose based on whether the directory is system-wide or service-specific, whether it must exist at boot or only during a service run, and whether cleanup should be age-based or explicit.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

