Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: Runit and /tmp directory (Read 2099 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Runit and /tmp directory

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.
We should try to be kind to everyone.....we are all fighting some sort of battle.

Re: Runit and /tmp directory

Reply #1
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
Code: [Select]
/bin/rm -fr /tmp/{.*,*} &> /dev/null

Re: Runit and /tmp directory

Reply #2
You could mount /tmp with tmpfs via fstab.

eg

Code: [Select]
tmpfs                                   /tmp    tmpfs       defaults,noatime,mode=1777     0 0


More detail on arch wiki.

Re: Runit and /tmp directory

Reply #3
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).
now only the dinit guy in artix

Re: Runit and /tmp directory

Reply #4
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.
We should try to be kind to everyone.....we are all fighting some sort of battle.

Re: Runit and /tmp directory

Reply #5
Code: [Select]
tmpfs                                   /tmp    tmpfs       defaults,noatime,mode=1777     0 0

Is that mode definition, I imagine access rights to tmpfs, something specific for ssd and how does it differ from:  ?

Code: [Select]
tmpfs   /tmp   tmpfs   defaults,nosuid,nodev  0  0

 

Re: Runit and /tmp directory

Reply #6
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).