[rhn-users] auto cleanup of /tmp on boot

Corne Beerse cbeerse at gmail.com
Thu Aug 31 15:04:12 UTC 2006


allen.jordan at convergys.com wrote:

>
>
>Is there something already in place in the OS that will clean up /tmp on a
>boot?
>Or do I need to add my own script?
>If so, does anyone have a script?
>  
>

For what it is worth: the long-time unix default is to remove all files 
from /tmp on boot. Directories in there tend to stay there with their 
contents. It is in one of the `rc` files (see /etc/init.d) and it should 
be called relative early in the boot process. However, it should not be 
passed when booting to single-user mode: thats a location to trace stuff 
where the previous contents of /tmp can come in handy.

My opinion is that it should also remove the subdirectories (the entire 
tree below /tmp) and one should expect that: Lots of current 
implementations have /tmp on a filesystem that is cleared on boot. For 
example on a ramdisk or such.

If a tool needs a boot-save temporary storage, use /var/tmp. That is 
there for ages too: vi uses it for example.


Regards

CBee




More information about the rhn-users mailing list