On 18/02/2020 23.17, Per Jessen wrote:
Dave Howorth wrote:
Also how do I set the system to clear /tmp on reboot?
The best starting place is probably "man tmpfiles.d". or you add own cronjob.
I'm afraid I found that page impenetrable, like other people I found asking when I googled. How would I use it? Or how would I set up a cronjob?
This ought to do it:
@reboot root find /tmp/ | xargs -r rm -Rf
By that time, something might already be using it. Just put it here: Telcontar:~ # ls /etc/init.d/*local /etc/init.d/after.local /etc/init.d/boot.local One runs before the init, another runs after. I would place there a find to delete 6 month old files - unless typical uptime is 6 months, then I would choose a longer time or include the typical uptime as a value somehow.
Or you keep /tmp on an in-memory filesystem.
Something needs to clear /tmp as the system is booted and before anything can create a file (or socket etc) in it. But at what point is that where /tmp exists but isn't used? Or can it just be recreated somehow? (it's a btrfs subvolume on my system - I know nothing about any possible mechanisms). How to get the right time in the boot sequence?
More to the point - why does it matter?
Doing it at the correct instant? Because you may delete temporary files from a running process. Deleting it at all on every boot? I do not see why.
It annoys me to have to override default conf just to get back to how the system is supposed to work
There is plenty of that, Dave. The default never works for me, not even on plain office desktop systems. At the very least, the postfix and the syslog configs have to be adapted.
I haven't touched either.
Much depends on your (and my) definition of "how the system is supposed to work". That is why the default is only good enough for the most basic setup.
right. -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)