Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing /tmp at boot time?

Status
Not open for further replies.

aixmurderer

IS-IT--Management
Nov 28, 2000
603
NZ
Some OS's I have worked on (Sol 2.6) seems to clear out /tmp by default at boot time, AIX doesn't seem to offer the option.

Was thinking of running something from the rc.shutdown to do so, but are interested to find out how others do it.

Your advice and ideas will be appreciated.

Chris

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Some thoughts:

Running a script from rc.shutdown could do it, but if there is a problem with the script, the shutdown would abort. So you would want to really want to test the script to make sure it won't fail.

You might want to consider putting a script in init.d (or the rc.n scheme AIX has been putting in place) to do this rather than in rc.shutdown.

If your users are used to seeing things they may have saved to /tmp after a boot, you should let them know files in /tmp will be deleted. (clearing /tmp on a boot was a BIG deal at a place I worked.)


Hope this helps.
 
hi,
in all server at my customer I create a script, called "switchoff" or similar, and in it I put all needed to shutdown correctly the machine. It is saved in a place in which I put all customized tools and script . (For workstations these are stored on server and executed at ws).

In this script I put things as:

rm -r /tmp/*
rm -r /tmp/.[A-z]*

# for NFS
rm /etc/state
rm -r /etc/sm /etc/sm.bac

# other ....

shutdown -F
or
shutdown -Fr


bye
 
Thanks guys. Had some problems before with rc.shutdown, so I have reverted to previously employed shutdown (reboot) script which I run from the cron instead, needing to stop stuff like MQSeries Queue Managers first.

The users have been briefed on not to expect stuff in /tmp to survive, simply because of them leaving MB's hanging around, causing system problems when the nightly sysbackup takes place.

victorv, I think I will do as you do and add the bits to my shutdown script, I was just a bit concerned that some system related tmp files may cause problems if deleted before the shutdown -Fr takes place. Guess the only way to find out would be to simply go ahead and do it.

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Yes, you have to be careful about not deleting something that an application may be using. (some apps put a log file in /tmp.) What about deleting files based on the age of the timestamp?
 
a hack i sometimes used was to have scripts called from rc.shutdown return a zero in odd situations rather than some error. just adding 'exit 0' to the end of the script does the trick if you don't have time to work on it.

generally i like for people to get comfy using /tmp for long-term storage before i rm -r /tmp, but my clients are used to abuse. =)

IBM Certified -- AIX 4.3 Obfuscation
 
Greeting aixmurderer!

You should install solaris shell on AIX. It is helpful for Solaris admin who wants to learn AIX.

Take a look on the rc.boot script, you can add any processing has to happen at boot time.

Tell u secret, AIX admins doesn't care about /tmp clean up. Infact they like to retain it for long time. AIX skulker daemon wakes up like a vampire and sucks all blood of dead files.

 
abutifilmnd

"You should install solaris shell on AIX. It is helpful for Solaris admin who wants to learn AIX"

How does that work then ? If you want to learn AIX - use it :)

Alex
 
abutifilmnd - I am an AIX man, I am spoiled by the ease of sysadmin AIX offers.

The reference to /tmp clearing on Solaris was some painful experience I learned along the way when stuff disappeared from /tmp after a boot.

IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
MS Certified Windblows Rebooter
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top