Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
tmpfs but on boot still "Wiping /tmp directory"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 105
Location: Belarus

PostPosted: Tue Aug 27, 2024 7:07 am    Post subject: tmpfs but on boot still "Wiping /tmp directory" Reply with quote

Hi, how do disable that wiping - because this is pointless to clear that RAM on boot, yes?

Should I set no in /etc/init.d/bootmisc?

I will update https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs after finding the correct answer

Thanks for the help.

And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM.
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1629
Location: Germany

PostPosted: Tue Aug 27, 2024 7:49 am    Post subject: Reply with quote

Quote:
Hi, how do disable that wiping - because this is pointless to clear that RAM on boot, yes?

What would be the benefit of not wiping it?

Quote:
And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM.

In the age of SSD and NVME the difference in performance will not be significant as the difference between older SSD, HD and RAM. So try it and see it for your self if something is faster
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3334

PostPosted: Tue Aug 27, 2024 10:13 am    Post subject: Reply with quote

Quote:
And by the way - what is your opinion about tmpfs? Is it a good practice to enable it? My laptop is 16 GB of RAM.
There is little reason to store temporary files on disk in the first place, so yes, usually it is good, unless it makes you run out of precious RAM.
16GB is plenty, so you should be good, but if you're ever short on RAM, you can make up for it by enabling SWAP. Combining it with low (but non-zero) value in vm.swappiness (from sysctl) should give you the best of both worlds: keep stuff in RAM as long as possible, but still complete big builds without assistance from OOM killer.


Quote:
tmpfs but on boot still "Wiping /tmp directory"
A newly mounted tmpfs is empty, so there's nothing to wipe.
So yes, it is pointless. Unless, for whatever reason you change your setup later and /tmp will happen to be on a persistent storage, and suddenly you start accumulating clutter.
Honestly clearing the empty /tmp never bothered me nearly enough to look for a solution. I've had it indicate a damaged filesystem on a persistent storage a few times though, after machine got hit with a power outage.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 105
Location: Belarus

PostPosted: Wed Aug 28, 2024 12:38 pm    Post subject: Reply with quote

I set them to no but still see Cleaning /tmp directory on boot :(

What is the correct way to disable it?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22401

PostPosted: Wed Aug 28, 2024 12:52 pm    Post subject: Reply with quote

As I read /etc/init.d/bootmisc, you did disable it. The thread started with a report that it was Wiping tmp. Now, it is Cleaning tmp. Per the log messages in that script, cleaning is what happens when you disallow a total wipe. It looks like this might get skipped if the script determines that the directory is a tmpfs. However, this is speculation on my part.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1838

PostPosted: Wed Aug 28, 2024 1:23 pm    Post subject: Reply with quote

Code:
   # Clean up /tmp directories
   local tmp=
   for tmp in ${clean_tmp_dirs:-${wipe_tmp_dirs-/tmp}}; do
      mountinfo -q -f tmpfs "$tmp" || cleanup_tmp_dir "$tmp"
   done

By this code (line 205):
  1. It looks to the value set by clean_tmp_dirs. If it is an empty string, wipe_tmp_dirs is looked at. If both are an empty string, nothing occurs. (This is different from not setting or commenting out.)
  2. If $tmp is mounted as a tmpfs at this point, don't do anything.
  3. If not mounted as tmpfs, run the cleanup_tmp_dir function which wipes or cleans by the wipe_tmp setting


Last edited by grknight on Wed Aug 28, 2024 1:35 pm; edited 1 time in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1637
Location: South America

PostPosted: Wed Aug 28, 2024 1:24 pm    Post subject: Reply with quote

Therefore, OP, what's the output of /lib/rc/bin/mountinfo --fstype /tmp?
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20346

PostPosted: Wed Aug 28, 2024 3:51 pm    Post subject: Reply with quote

https://www.gentoo.org/support/news-items/2022-11-21-tmpfiles-clean.html
Quote:
If you wish to opt-out, simply comment out the command in
/etc/cron.daily/systemd-tmpfiles-clean.

_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22401

PostPosted: Wed Aug 28, 2024 4:02 pm    Post subject: Reply with quote

I think that is not related to this thread. The systemd-tmpfiles-clean job will go through and periodically delete old files from /tmp while the system is up. OP is inquiring about an OpenRC at-boot behavior.
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20346

PostPosted: Wed Aug 28, 2024 4:41 pm    Post subject: Reply with quote

I thought by definition a RAM based file system was ephemeral. I'm confused by the use of a portage tmpfs and then wanting it not on a tmpfs.
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22401

PostPosted: Wed Aug 28, 2024 5:53 pm    Post subject: Reply with quote

Yes, a tmpfs is discarded at shutdown. There is no point to clearing individual files from a freshly mounted tmpfs because there will not be any files, which I think is why OP wants to know why his system is trying to clear it. I do not see why OP brought https://wiki.gentoo.org/wiki/Portage_TMPDIR_on_tmpfs into this, since PORTAGE_TMPDIR is usually /var/tmp, not /tmp, and this thread seems to be focused on /tmp.
Back to top
View user's profile Send private message
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 105
Location: Belarus

PostPosted: Thu Aug 29, 2024 8:12 am    Post subject: Reply with quote

Sorry reverted my addition to the Wiki.
Back to top
View user's profile Send private message
vitaly-zdanevich
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2019
Posts: 105
Location: Belarus

PostPosted: Thu Aug 29, 2024 8:14 am    Post subject: Reply with quote

GDH-gentoo wrote:
Therefore, OP, what's the output of /lib/rc/bin/mountinfo --fstype /tmp?

tmpfs
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum