I have recently installed Artix on a Dell laptop and decided to give the runit version a try. I like kde plasma and I am using that de. Everything went smoothly and my system is working great. However, I notice that my /tmp directory is accumulating a lot of files indicating that is isn't being cleaned. I am unfamiliar with runit since previously I used the openrc version of Artix.
I would like to know how to configure my system to clean /tmp?
Best regards.
Not sure how runit handles /tmp at boot, but have you considered using tmpfs? If you don't store large files in /tmp or if you're on SSD drive and want to keep wear levels low, tmpfs is a neat solution. Otherwise,
/etc/rc.local is a good place to put
/bin/rm -fr /tmp/{.*,*} &> /dev/null
You could mount /tmp with tmpfs via fstab.
eg
tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0
More detail on arch wiki (https://wiki.archlinux.org/index.php/Tmpfs).
By default our implementation does not clean /tmp on boot, unlike OpenRC in /etc/init.d/bootmisc.
Our stage1 is yet to support it (and if we do add it, it will be disabled by default), but I can implement it later after mid-terms this week.
You can use nous' solution and put his workaround to /etc/rc/rc.local, or use artoo's solution and mount /tmp as tmpfs (it will use RAM, iirc).
Thank you for the helpful replies. I decided to go with
@nous' workaround/solution, and after a reboot my /tmp is much cleaner.
Thanks once again to all who replied. :)
Best regards.
Is that mode definition, I imagine access rights to tmpfs, something specific for ssd and how does it differ from: ?
tmpfs /tmp tmpfs defaults,nosuid,nodev 0 0
In fstab context, 'defaults' are rw, suid, dev, exec, auto, nouser, and async. Options nosuid and nodev prohibit creation of, well, suid and device files. Option noatime speeds up things a little by not writing access times (useful for HDDs and SSDs, irrelevant for tmpfs) and mode sets initial permissions of the root directory (only useful if you've forgotten to set 1777 yourself).