Please support VectorLinux!

Author Topic: what's the deal with the tmp folder?  (Read 881 times)

MarkGrieveson

  • Vectorian
  • ****
  • Posts: 531
what's the deal with the tmp folder?
« on: March 20, 2012, 08:18:21 pm »
Hello.  I used to use Debian, and there the /tmp folder was actually temporary.  Generally on a new boot up it started off almost empty, meaning it would be cleared with each new use.  I notice in Vector there's a huge amount of stuff in the /tmp folder even when I've just booted into the system.  So, stuff from previous usage seems to be preserved there (IE, it doesn't seem to be temporary).  What is the deal with this?
I am using VL7.0 standard with XFCE

bigpaws

  • Vectorian
  • ****
  • Posts: 1868
Re: what's the deal with the tmp folder?
« Reply #1 on: March 21, 2012, 04:59:42 am »
/tmp is used for more than temporary files. It is also used
for file locking and other purposes. Also slackbuilds uses
/tmp to store any programs you may have built.

This is within the File System Hierarchy standard.

Bigpaws

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: what's the deal with the tmp folder?
« Reply #2 on: March 21, 2012, 10:47:51 am »
so, is there a way to set it to empty on boot?

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4072
Re: what's the deal with the tmp folder?
« Reply #3 on: March 21, 2012, 05:40:41 pm »
You can add the line "rm -rf /tmp/*" to /etc/rc.d/rc.local. Just make sure you get the syntax right! ;)

pierce.jason

  • Packager
  • Vectorite
  • ****
  • Posts: 250
Re: what's the deal with the tmp folder?
« Reply #4 on: March 21, 2012, 06:21:26 pm »
You can also set it to use a ramfs, if you have enough ram. This can speed up certain operations quite a bit. Many distros automatically clear out /tmp
pierce.jason
Email: $(echo -e "moc\x2eliamg\x40nosaj.ecreip" | rev)

nightflier

  • Administrator
  • Vectorian
  • *****
  • Posts: 4072
Re: what's the deal with the tmp folder?
« Reply #5 on: March 22, 2012, 04:37:35 am »
I've do use tmpfs for /tmp dir. It works great, but if you go that route, look out for some "gotchas". Some programs need a large amount of working space. In my case, I had to configure K3B to use a different location, because DVD images exceed my RAM capacity.

danthemannewtolinux

  • Vectorite
  • ***
  • Posts: 107
Re: what's the deal with the tmp folder?
« Reply #6 on: March 22, 2012, 07:05:58 am »
thanks guys, added the rm command to rc.local