- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how do HP-UX create temporary files
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 10:57 AM
тАО12-06-2001 10:57 AM
how do HP-UX create temporary files
Recently, my /var/tmp has reached 100% space usage due to some files created by oracle shadow process. My server run on HP-UX 11.00 64 bit. I have been wondering how do HP-UX create a temporary file, does it use tempnam() or tmpnam(). It seems that even if I change my TMPDIR to different location, the temporary files were still being created in /var/tmp. Look likes it use tmpnam() to create temporary files because tmpnam() will always create file in /var/tmp no matter what is the value of TMPDIR.
Anyone has any information regarding this issue.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:43 AM
тАО12-06-2001 11:43 AM
Re: how do HP-UX create temporary files
Use lsof to see what's making files in /var/tmp - if Oracle is the hog, log a tar with Oracle to get them to help you figure out what's happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:43 AM
тАО12-06-2001 11:43 AM
Re: how do HP-UX create temporary files
Only some utilities use the environmental variable TMPDIR to select the directory for temporary files. 'sort' (using the '-t') option is one of them).
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:45 AM
тАО12-06-2001 11:45 AM
Re: how do HP-UX create temporary files
You need to set and export the variable TMPDIR, so that it points to the directory you want it to use.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:46 AM
тАО12-06-2001 11:46 AM
Re: how do HP-UX create temporary files
you may also want to take a look at this thread,
http://us-support2.external.hp.com/cki/bin/doc.pl/sid=a8c720af052550bab9/screen=ckiDisplayDocument?docId=200000012779122
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:50 AM
тАО12-06-2001 11:50 AM
Re: how do HP-UX create temporary files
HP-UX OS doesn't create temp files on it's own but the utilities/softwares do. For ex., if we edit a file, the copy will be placed under /var/tmp/ as Ex$$ ($$ being the pid). So if someone edits a 50MB file /var will be increased by 50MB due to this copy. If the vi is abnormally shut (like closing the telnet window), this will remain and occupy the space.
So, it is a good practice to remove the files that are 3-4 days older from these temp directories.
Another way is by people like me who create temp files in their scripts/programs but do not clean up before exiting them. So, they also will remain.
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:57 AM
тАО12-06-2001 11:57 AM
Re: how do HP-UX create temporary files
It varies. If the programmers have been beaten over the head and told to honor the TMPDIR convention then you should be fine. The tempnam() and tmpnam() functions do honor this. Also, bear in mind that TMPDIR must be set before the process is started or it will have no effect.
When the programmers are really sneaky they'll do this to you:
fname = tmpnam(char *) NULL);
fdes = open(fname,O_RDWR | O_CREAT,0600);
unlink(fname);
...
...
...
close(fdes);
In this case, even though the file has been unlinked and thus you won't see it, as long as the process has it open, the space is used. This is a pretty standard technique and in fact the tmpfile() function does this.
Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 11:58 AM
тАО12-06-2001 11:58 AM
Re: how do HP-UX create temporary files
Chris, I have opened a TAR with Oracle regarding this issue and Oracle's feedback is indicate that this is O/S related problem (dependency) and ask me to check with HP. On Sun TMPDIR directory can be redirect because i use tempnam() instead of tmpnam (This is according to Oracle).
Anyway thanks for the feedbacks. I guess I will create cron to cleanup the directory.
Thanks.
I also notice that if I use crontab -e , a temporary file will be created on /var/tmp on HP but /tmp for Sun Solaris.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 12:07 PM
тАО12-06-2001 12:07 PM
Re: how do HP-UX create temporary files
Here's a snip of man tmpnam:
tempnam() allows the user to control the choice of a
directory. The argument dir points to the name of
the directory in which the file is to be created.
If dir is NULL or points to a string that is not
an appropriate directory name, the path-prefix
defined as P_tmpdir in the
is used. If that directory is not accessible,
/tmp is used as a last resort. This entire
sequence can be up-staged by providing an
environment variable TMPDIR in the user's
environment, whose value is the name of the
desired temporary-file directory.
tmpfile(3) and mktemp(3) are also available.
BTW, check the perms of /var/tmp - we make the perms on tmp directories 1777 instead of 777; which means that you have to own the file to remove it from tmp. These perms break some setuid programs like sendmail hooked to procmail.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-06-2001 10:45 PM
тАО12-06-2001 10:45 PM
Re: how do HP-UX create temporary files
I guess you should be having problems installing Oracle 9iAS. :)
I had similar problems on my HP_UX 11 64-bits.
I finally ended exporting TMP, TMP_DIR and TMPDIR.
It worked the dirty way!! I can't tell you for sure which one it used.
I am sure Oracle will be able to answer this question much better.
regards
Yogeeraj