You are not logged in.

#1 2010-04-23 13:28:37

pogeymanz
Member
Registered: 2008-03-11
Posts: 1,020

What is /var/tmp for?

Mine has some KDEcache crap in it right now, but I noticed it doesn't seem to be cleared at boot, like /tmp does:
/etc/sysinit.rc

...
stat_busy "Removing Leftover Files"
/bin/rm -f /etc/nologin &>/dev/null
/bin/rm -f /etc/shutdownpid &>/dev/null
/bin/rm -f /var/lock/* &>/dev/null
/bin/rm -rf /tmp/* /tmp/.* &>/dev/null
/bin/rm -f /forcefsck &>/dev/null
(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
: >| /var/run/utmp
/bin/chmod 0664 /var/run/utmp
# Keep {x,k,g}dm happy with xorg
/bin/mkdir /tmp/.ICE-unix && /bin/chmod 1777 /tmp/.ICE-unix
/bin/mkdir /tmp/.X11-unix && /bin/chmod 1777 /tmp/.X11-unix
stat_done
...

Does it ever get cleared? If not, why is it called "tmp"?

Offline

#2 2010-04-23 13:36:03

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,488
Website

Offline

#3 2010-04-23 19:29:57

azleifel
Member
Registered: 2007-10-28
Posts: 486

Re: What is /var/tmp for?

This is what I do:

$ sudo rm -rf /var/tmp
$ sudo ln -sf /tmp /var/tmp

Edit: And that's despite what it says in the FHS.

Last edited by azleifel (2010-04-23 19:31:37)

Offline

#4 2010-04-23 20:24:06

Wintervenom
Member
Registered: 2008-08-20
Posts: 1,011

Re: What is /var/tmp for?

/etc/rc.tmpfs

#!/bin/sh

# Bind to already-existing tmpfs so we do not waste memory.
mkdir -p /dev/shm/{tmp,lock}
mount --bind /dev/shm/tmp /tmp
mount --bind /dev/shm/tmp /var/tmp
mount --bind /dev/shm/lock /var/lock
chmod 1777 /dev/shm/{tmp,lock}

/etc/rc.sysinit

#...
/bin/rm -f /forcefsck &>/dev/null

. /etc/rc.tmpfs

(cd /var/run && /usr/bin/find . ! -type d -exec /bin/rm -f -- {} \; )
#...

Last edited by Wintervenom (2010-04-23 20:25:29)

Offline

#5 2010-05-26 18:47:59

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: What is /var/tmp for?

Wintervenom wrote:

/etc/rc.tmpfs
/etc/rc.sysinit

What would be the best way to go about this in such a way that it would survive an update of the initscripts package?

Last edited by MkFly (2010-05-26 18:49:33)

Offline

#6 2010-05-26 21:47:54

Barrucadu
Member
From: York, England
Registered: 2008-03-30
Posts: 1,158
Website

Re: What is /var/tmp for?

MkFly wrote:
Wintervenom wrote:

/etc/rc.tmpfs
/etc/rc.sysinit

What would be the best way to go about this in such a way that it would survive an update of the initscripts package?

Could just use /etc/rc.local

Offline

#7 2010-05-26 22:27:18

MkFly
Member
From: Mars
Registered: 2009-12-10
Posts: 141

Re: What is /var/tmp for?

Barrucadu wrote:
MkFly wrote:
Wintervenom wrote:

/etc/rc.tmpfs
/etc/rc.sysinit

What would be the best way to go about this in such a way that it would survive an update of the initscripts package?

Could just use /etc/rc.local

Sure, but by that time, rc.sysinit has already written a few things to /tmp, not to mention whatever files are put there by daemons (which I believe should be up by the time we get to rc.local).

Offline

#8 2010-05-26 23:09:45

some-guy94
Member
Registered: 2009-08-15
Posts: 360

Re: What is /var/tmp for?

Any reason you're not just using fstab?

Offline

#9 2010-06-02 10:20:54

sagecss
Member
Registered: 2009-03-14
Posts: 4

Re: What is /var/tmp for?

If I delete the contents of /var/tmp my user account fails to run my Gnome DE.

I have been messing around with encryption and:
1. Encrypted swap
2. Have /tmp setup in fstab as a tmpfs
3. Read somewhere that I can have leakage to /var/tmp as well. Not sure of the extent though.

Should /var/tmp rather be left alone or is there a way to get this done without borking anything?

Thanks,
Sage

Offline

Board footer

Powered by FluxBB