On Wed, 19 Feb 2020 14:35:07 +0100 "Carlos E. R." <robin.listas@telefonica.net> wrote:
On 19/02/2020 12.09, Dave Howorth wrote:
On Tue, 18 Feb 2020 23:17:35 +0100 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
OK I'll try that, thanks. I wasn't sure when @reboot got run.
Or you keep /tmp on an in-memory filesystem.
Well, no. I agree with the notion that /tmp should be on a disk/SSD rather than in RAM. If something wants temporary files in RAM, it's free to use /run
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?
Well, it obviously has to be late enough in the boot process that /tmp exists and is mounted, but it needs to be before any service has started and stored a *.pid or created a socket or whatever in /tmp.
Then cron (@reboot) is too late. /etc/init.d/boot.local exists for those purposes.
That's a sysVinit feature (and maybe hangover?) not a systemd one. So I'd much rather use the systemd equivalent, but as already stated I find the man page impenetrable. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org