[Ilugc] X Server Problem Solved

  • From: andyetitmoves@xxxxxxxxx (Ramkumar R)
  • Date: Fri Jul 8 14:58:47 2005

Is there any problem due to deletion of tmp files?

A blanket rm -rf * .* as root in the init 3/5 stage is for sure
inviting trouble. Some applications, like orbit (most gnome apps need
it), xfs etc. may put their control sockets over there. You might face
problems with opening new applications. Well designed running
applications using tmp files shouldn't be affected by deletion, as it
is usually advised to keep the temp file open throughout the program.
Unix unlinking semantics ensure then that deleting the file doesn't
affect the program. Again, to be on the safer side, better not to do
it.

Most distros do clean up the tmp folder at boot time, and through a
cron script. If you really want to clean up your tmp manually, it is
usually safe to go to init 1 by using 'telinit' so that almost all
apps get closed, and then come back to init 3/5.

The solution I use is to have tmpfs mounted on /tmp. All files in a
tmpfs are stored in the kernel buffer cache (memory if possible, swap
otherwise), and hence all contents are automatically lost on a reboot.
Morever, it is likely to be faster, since it avoids the disk as much
as possible. Caveats: you lose anything that you store in /tmp (You
shouldn't be doing that anyway !). Secondly, ensure that you don't
allocate too much space for it (using size parameter in mount). If you
happen to fill up all of the space, and there is no virtual memory
left for other programs, your computer will lock. There is usually a
tmpfs mounted on /dev/shm to form with POSIX. If you don't want two
partitions, you will need to symlink /dev/shm to a folder in /tmp, or
vice versa...this might need hacking your init scripts.

Hope this answers your question :)

it moves on...

-- 
The day Microsoft makes something that doesn't suck
is probably the day they start making vacuum cleaners.
                                               -Ernst Jan Plugge

Other related posts: