1823179 Members
3588 Online
109647 Solutions
New Discussion юеВ

Re: /var/tmp

 
SOLVED
Go to solution
Nobody's Hero
Valued Contributor

/var/tmp

OK, I hate to do this ,but I have no choice. Plus I've spent so many points here that I feel like I am entitled. But delete this post if you want, I am ashamed.

I am an HP person, have been for years.
Now I am in an HP/Solaris shop.

Hp has a switch to set to clear /var/tmp at reboot.

Does solaris have one? a switch to set to make it clear at reboot? and if there are any Sun people out here, is it a good idea to do so?

Sorry, I couldnt find any answers on sun sites. I think I hit the end of the internet while searching.

10x
RPM
UNIX IS GOOD
4 REPLIES 4
john kingsley
Honored Contributor
Solution

Re: /var/tmp

Look in the file /etc/init.d/RMTMPFILES

In this file there is a note:

# Traditional SunOS 4.x behavior has been to not alter the contents of
# /var/tmp (/usr/tmp) at boot time. This behavior is maintained as the
# current default behavior. It the traditional System V behavior of
# removing everything in /var/tmp is desired, remove the following 'exit'.

exit


If you comment this exit line it should work.

There should also be a hard link between
/etc/init.d/RMTMPFILES &
/etc/rc2.d/S05RMTMPFILES
A. Clay Stephenson
Acclaimed Contributor

Re: /var/tmp

It really doesn't matter because whatever "built-in" mechanisms exist to delete temporary files, you still have to look at the rc scripts to see if custom versions are in use. While clearing temporary files from /tmp, /usr/tmp, and/or /var/tmp used to a common rc practice, boxes are rebooted so infrequently nowadays that these rc scripts are all but worthless. It is much more common to rely upon cron scripts to do cleanup these days.
If it ain't broke, I can fix that.
Darrel Louis
Honored Contributor

Re: /var/tmp

Hi,

I've checked on Solaris 5.9 and found the following two scripts dealing with /var/tmp:
PRESERVE
RMTMPFILES

But on Solaris 5.10 I don't have it, so it could be that Sun has another mechanism for this, which I can't find at the moment.

Darrel
Geoff Wild
Honored Contributor

Re: /var/tmp

Talking with a Sun Guru on my team and he says there is no builtin mechanism to delete files from /var/tmp on Solaris.

On Solaris, /var/tmp is used by applications, things like vi sessions.

DO NOT make it a symbolic link to /tmp - as that is a memory mapped file system and programs like vi expect to see a physical file systems.

Best to write your own rc script to rm files leftover in /var/tmp

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.