systemd /tmp cleaning is suboptimal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Fix Released
|
Wishlist
|
Nick Rosbrook | ||
Noble |
Fix Released
|
Wishlist
|
Nick Rosbrook |
Bug Description
Historically on Debian and Ubuntu, before systemd, the default handling of /tmp was to periodically, and at boot, remove all files/directories older than 30 days; and leave other contents alone.
With the move to systemd, the "default" (really, hard-coded in /usr/lib/
This is suboptimal for two reasons.
By cleaning /tmp *only* at boot, if a system makes heavy use of /tmp and has lots of inodes under it, possibly due to failures of some process to clean up after itself, at boot the system will be unavailable for an unnecessarily long time while these files are removed.
By cleaning *all* files under /tmp, this makes a reboot an Event where in-progress files may be unnecessarily lost.
While the FHS does not *guarantee* that files under /tmp will persist across boot (because /tmp may be a tmpfs), it also does not *require* that /tmp be cleared on boot.
Although data stored in /tmp may be deleted in a site-specific
manner, it is recommended that files and directories located in
/tmp be deleted whenever the system is booted.
FHS added this recommendation on the basis of historical
precedent and common practice, but did not make it a
requirement because system administration is not within the
scope of this standard.
I therefore believe the correct value for /usr/lib/
tags: | added: rls-nn-incoming |
Changed in systemd (Ubuntu Noble): | |
status: | Confirmed → Triaged |
assignee: | nobody → Nick Rosbrook (enr0n) |
I personally have become very accustomed to the current behavior where /tmp is emptied on reboot -- I have no idea what most users would say about this, so I wonder if changing that behavior would be unwelcome. I do think it could be nice to have the 30d behavior back, however.
In other words, if we did change this I think my preference would be:
D /tmp 1777 root root 30d
so that we still always clear on boot, but also after 30d if needed.
On the other hand, this feels like it might be something that most people don't care about, and those that do are welcome to change their local system.