[WBEL-users] tmpwatch command

bishop bishop@platypus.bc.ca
Wed, 15 Sep 2004 12:40:11 -0700


Kirby C. Bohling wrote:

> On Wed, Sep 15, 2004 at 11:35:17AM -0600, Jason Becker wrote:
> 
>>Hi All,
>>
>>My servers don't get rebooted very often but when they do I'd like /tmp 
>>to be cleared out. I really like the *BSD clear_tmp_enable (in rc.conf) 
>>method for doing this. Linux has tmpwatch. Would someone care to share 
>>there command line for a cron job?
> 
> 
> /etc/cron.daily/tmpwatch
> 
> It's a standard part of most recent RedHat releases.
> 
> If you really want to have it cleared, use tmpfs instead of a real
> filesystem (it'd be more real "UNIX" like from what I'm told).  I
> know someone just today replied with how well it works on the list.

If you do use tmpfs, DO ensure you've set it high enough so you don't 
run out of space.  I work on Real Unix at work, and we find that the 
amount to which some apps spew stuff into /tmp is a bit of a space issue 
at times.

I actually disable the slice for many installations, including when I 
intend to install Oracle, for instance, because some apps hit the mem 
and tmp at a rate best demonstrated by rats in cocaine studies.

> There is where I first read about it, it's written by the guy who
> started Gentoo:
> http://www-106.ibm.com/developerworks/library/l-fs3.html
> 
> However, I'm told that tmpfs has caused weird problems in the past
> on several lists I'm on.  Essentially, using readdir while files are
> being added or removed might not work the way a standard filesystem
> does (the list isn't stable, so if a file "A" is removed, file "B"
> might show up via readdir twice, once before "A" was removed, and
> once after "A" was removed).  I'm not sure that it still exists, but
> I know that it caused problems for both BitKeeper and for
> Subversion.
> 
> Don't ask, I don't get it.  I know that lots of people do this,
> but every once in a while it'll cause problems with applications.
> My personal best "/tmp", is that if /tmp is a softlink, on some
> versions of Linux Kernel/glibc you won't be able to change your
> crontab entry using vim as your editor.  There's some kind of race
> condition.  I've learned it's just best to just use a standard
> filesystem for it, and have a dedicate partition for it.

Sounds like the linux tmpfs needs a bit of a lock, that's all.

It's not just vim checking (lstat?) for the presence of a link in the 
file path anywhere?  That'd be my guess as to why it's failing there: 
it's a security bug, potentially of course, to edit a file that's really 
a link to someplace else.

> 	Kirby
> 
> 
>>TIA
>>
>>Cheers
>>
>>-- 
>>Jason Becker
>>Director & CEO
>>Coalescent Systems Inc.
>>403.244.8089
>>www.voxbox.ca
>>
>>_______________________________________________
>>Whitebox-users mailing list
>>Whitebox-users@beau.org
>>http://beau.org/mailman/listinfo/whitebox-users
>>
> 
> _______________________________________________
> Whitebox-users mailing list
> Whitebox-users@beau.org
> http://beau.org/mailman/listinfo/whitebox-users