Operating System - HP-UX
1820390 Members
3368 Online
109623 Solutions
New Discussion юеВ

changing /var/tmp to /tmp in /usr directory

 
SOLVED
Go to solution
wvsa
Regular Advisor

changing /var/tmp to /tmp in /usr directory

Greetings all;

Need to change (due to oracle) the reference in the /usr directory from /var/tmp to /tmp, reason being need more space for oracle log files. No problem with using ln -s but for the life of me cannot get the link permissions to be set to lrwxrwxrwt for tmp > /tmp in the usr directory, changing the umask gets me lrwxrwxrwx.

What am i missing? Thank you for your input

wvsa
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: changing /var/tmp to /tmp in /usr directory

It's a symbolic link.

1) cd /usr
2) rm tmp
3) ln -s /tmp tmp
4) ls -l tmp

Now, you should not do this. You should really create a larger /var/tmp and preferably as a seprate filesystem. For at least a decade the standard has been that /tmp is used for OS-related temporary files and /var/tmp is used for applications-related temporary files unless overridden by the TMPDIR environment variable.
If it ain't broke, I can fix that.
A. Clay Stephenson
Acclaimed Contributor

Re: changing /var/tmp to /tmp in /usr directory

Oh, and the other thing is that neither Oracle nor any of your scripts or programs should be using /usr/tmp; the use of /usr/tmp is deprecated; use /var/tmp.
If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: changing /var/tmp to /tmp in /usr directory

Hi:

The link 'usr/tmp' is what's called a transition link, and that's the reason for the 't' as if the sticky bit were set.

Transition links will disappear someday, perhaps in 11i v3. They are (re)generated if you run 'tlinstall'.

I suppose that there is no harm in doing what you propose, other than it is non-conventional.

Regards!

...JRF...
wvsa
Regular Advisor

Re: changing /var/tmp to /tmp in /usr directory

Hello CLay;

Could you please clarify your statement:
the use of /usr/tmp is deprecated; use /var/tmp.

Thank you!

Wvsa
James R. Ferguson
Acclaimed Contributor
Solution

Re: changing /var/tmp to /tmp in /usr directory

Hi:

As I indictated, you are looking at a "transition link" that is destined to be eliminated in a future release -- perhaps 11i v3.

The firectories '/usr/tmp', '/bin', '/lib' and others existed in HP-UX 9x and earlier releases. When HP-UX 10.0 became available, "transition links" were established to ease the upgrade path without having to re-write hundreds or thousands of lines of code when these directories were migrataged to '/var/tmp', '/usr/bin' and 'usr/lib', respectively.

The original whitepaper describing this transition can be found here:

http://www.docs.hp.com/en/5963-8942/5963-8942.pdf

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor

Re: changing /var/tmp to /tmp in /usr directory

It means that /usr/tmp is being phased out and may not be available in future releases. Essentially, when the /var filesystem was introduced (~ 15 years ago or so), it was intended to store transient data and /usr was expected to remain almost fixed in size over time. The symbolic link in /usr for tmp exists solely to prevent existing scripts from breaking but the intent is that new scripts and programs will use /var/tmp where they once used /usr/tmp.

One of my standards idioms for every script where temporary files are needed is something like this:

TDIR=${TMPDIR:-/var/tmp}
TFILE1=${TDIR}/X${$}_1.tmp
TFILE2=${TDIR}/X${$}_2.tmp

so that, by default /var/tmp is used unless ${TMPDIR} is defined, in which case, it overrides /var/tmp. The TMPDIR convention applies to all well-written UNIX code.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: changing /var/tmp to /tmp in /usr directory

As Clay points out, there is NO directory called /usr/tmp. If you use this command:

ls -dl /usr/tmp

you will see that is an a link pointing to /var/tmp. /usr is not a temp storage directory so /usr/tmp is definitely not to be used. Nor should /usr/tmp point to /tmp which is normally a few hundred megs. /usr is a system installation tree and also contains two legacy trees: /usr/local and /usr/contrib which should be relatively small.

Now /var is the busiest directory in HP-UX nad may need to be 1000 to 5000 megs in size. If it is too small, you will constantly have problems with everything (email, printing, logfiles, Oracle, etc). Note also that /var must be managed...you may thousands of temporary files in that directory that have never been removed. There have been dozens of questions on managing /var posted here in the forums. Be sure you understand the purpose of the directories in /var before you remove anythng.


Bill Hassell, sysadmin