Back in the day(?) I thought that the entire contents of /tmp would be wiped on every reboot. It sorta seems like it for Ubuntu 18.04, but with 22.04 that doesn't seem to be the case at all, with conf files in /etc/tmpfiles.d and elsewhere which describe what gets deleted.
Can anyone shed any light on this, at least for Debian/Ubuntu? When did this change?
On August 14, 2024 8:02:59 p.m. EDT, Kevin McGregor kevin.a.mcgregor@gmail.com wrote:
Back in the day(?) I thought that the entire contents of /tmp would be wiped on every reboot. It sorta seems like it for Ubuntu 18.04, but with 22.04 that doesn't seem to be the case at all, with conf files in /etc/tmpfiles.d and elsewhere which describe what gets deleted.
Can anyone shed any light on this, at least for Debian/Ubuntu? When did this change?
I think this article on LWN may be relevant:
https://lwn.net/Articles/975565/
I doubt it's intended behaviour for /tmp to be persistent, but maybe Canonical screwed something up and upgrades get the worst of both worlds (no tmpfs, but also no scheduled purging)?
On 2024-08-14 Kevin McGregor wrote:
Back in the day(?) I thought that the entire contents of /tmp would be wiped on every reboot. It sorta seems like it for Ubuntu 18.04, but with 22.04 that doesn't seem to be the case at all, with conf files in /etc/tmpfiles.d and elsewhere which describe what gets deleted.
Can anyone shed any light on this, at least for Debian/Ubuntu? When did this change?
All depends on the distro and what extra software you setup.
Many distros will have /tmp on tmpfs and thus it gets wiped every boot.
Some people may change that so it's on a disk system somewhere (I do this). Then it could be on its own partition, or shared with /. Those won't get wiped.
Unless you setup a tmpwatch / skulker type of program. Which you should look into if you want your /tmp regularly cleaned up.
tmpfiles.d to me mostly means the creation of files/dirs in so that daemons can start up properly. Looks like systemd may have taken this stuff over, and there's a systemd-tmpfiles-clean service/timer you can enable. This systemd stuff may make tmpwatch stuff obsolete... personally, I've disabled the systemd feature-creep stuff and use the old-school commands. Don't feed the Lennart!