3 ms·
> If you don't like this risk, you need to work in persistent storage. Which is literally what /var/tmp is and what the parent is advocating for. However, cle
by Spivak 2y ago
> If you don't like this risk, you need to work in persistent storage.
Which is literally what /var/tmp is and what the parent is advocating for.
However, clearing /tmp at boot is not the greatest technical choice. There's nothing really special about rebooting the system. The idea that files in /tmp are kept around for anywhere between minutes, hours, and days makes for bad policy which systemd-tmpfiles fixes quite elegantly. You shouldn't lose your temp file after 30 seconds because your machine lost power. You should be able to say "files created here are cleared after $short_time of inactivity."
- semi 2y agodoes inactivity mean writes? reads? stat() calls? IMO setting the expectation of 'wont survive a reboot' is more consistent. but even that fails with private tmp files that could be tied to ephemeral units
- Spivak 2y agomtime atime ctime? If it's good enough for logrotate it's good enough for /tmp.