noatime mount and find command

User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: noatime mount and find command

Post by witek » 1. Dec 2010, 07:48

Regarding crontab: Why removal of files from /tmp that were not touched for ie. last week from crontab is supposed to be dangerous? I don`t understand. That is why I was asking about find -atime option. You mount /tmp in RAM - thus it vanishes with every reboot. Why crontab is less safe?

I didn`t realize rc.local_shutdown can be used. Maybe explicit existence of this file would be helpfull. However I`m not sure if it is not too early to wipe /tmp during rc.local_shutdown call.

User avatar
thenktor
Salix Wizard
Posts: 2426
Joined: 6. Jun 2009, 14:47
Location: Franconia
Contact:

Re: noatime mount and find command

Post by thenktor » 1. Dec 2010, 13:02

X session and desktop environments store data in /tmp, so it may be a problem to remove them, even if they were not touched for some days (as long as the session is still running). It's for sure no problem to remove the files on shutdown, when no desktop session is running.
Image
burnCDDA (burns audio CDs)
geBIERt (German beer blog)

User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: noatime mount and find command

Post by witek » 1. Dec 2010, 14:11

thenktor wrote:X session and desktop environments store data in /tmp, so it may be a problem to remove them, even if they were not touched for some days (as long as the session is still running). It's for sure no problem to remove the files on shutdown, when no desktop session is running.
OK I understand this. There is @reboot directive in crontab so it might be scheduled there or as it is now: during startup in rc.S.

If someone has small disk and builds many packages with slackbuild then /tmp gets populated very fast and takes much space. In such case total wipe during boot is method of choice, in my opinion.

Shador
Posts: 1295
Joined: 11. Jun 2009, 14:04
Location: Bavaria

Re: noatime mount and find command

Post by Shador » 1. Dec 2010, 14:46

rc.local_shutdown is probably not the perfect place for such a cleanup either. The problem is that a lot of daemons like dbus, apache, ... are still running at that point.

The perfect point considering time is during the startup directly after all volumes have been mounted rw, but no services especially none which might need /tmp are running or during shutdown before any volume gets mounted and after most services are already terminated.
Nevertheless rc.local_shutdown is the solution more resistent to updates. But editing any of the init scripts is imho for a KNOWLEDGABLE user no big deal either, because he is prompted by dotnew about those changes during an update. So where to actually put that cleanup method is more like a compromise between simplicity and safety.

Still editing the init scripts is a bit like messing with the law of nature. The results can be unpredictable and fatal. For that reason I prefer to discourage wiki articles encouraging users to edit them.

normal users: put it into rc.local_shutdown --> should be pretty safe and is easier when updating
power users are power users and can do whatever they want: put it into rc.S or rc.0 if you want
Image

User avatar
witek
Posts: 233
Joined: 16. Nov 2009, 13:41
Location: Poland.Łódź

Re: noatime mount and find command

Post by witek » 1. Dec 2010, 15:02

Shador wrote: For that reason I prefer to discourage wiki articles encouraging users to edit them.
What about wiki articles that dicourage users to edit them and only to mention the possibility? ;)
Just kidding, I understand your point but as I said before - sometimes automation of wiping /tmp is needed and someone may want to edit this scripts at his own risk.

Post Reply