[Bug 2019026] Re: systemd /tmp cleaning is suboptimal
Brian Murray
2019026 at bugs.launchpad.net
Wed Feb 14 22:22:27 UTC 2024
The Ubuntu QA team encountered an issue where our autopkgtest-cloud-
workers in the prod-proposed-migration environment ran out of free space
in /tmp because these are production servers which are rebooted very
infrequently. Due to some bug in the autopkgtest-cloud or autopkgtest
code there were left over log files from late November, December, and
January in /tmp. These log files can be quite large and our 200G /tmp
partition ended up being full quite regularly.
I too would expect /tmp to be cleaned up regularly and remember the days
when it was.
It be interesting to see what other server administrators do about
cleaning up /tmp. Does everyone modify /usr/lib/tmpfiles.d/tmp.conf ?
** Changed in: systemd (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2019026
Title:
systemd /tmp cleaning is suboptimal
Status in systemd package in Ubuntu:
Confirmed
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/tmpfiles.d/tmp.conf) is to not clean /tmp periodically, but
at boot to remove all contents.
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/tmpfiles.d/tmp.conf
to restore past behavior is 'd /tmp 1777 root root 30d'.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2019026/+subscriptions
More information about the foundations-bugs
mailing list