Re: Question: mount /var/run as tmpfs
martin f krafft <email@example.com> writes:
> also sprach Aleksey Midenkov <firstname.lastname@example.org> [2006.10.30.0902 +0100]:
>> It is possible to detect if kernel supports tmpfs and mount it
>> on /var/run, /var/lock, /var/tmp and maybe /tmp and may be other places.
> Definitely not /var/run, since its contents can survive reboots.
> /var/run works fine though; I have not tried /var/tmp. /tmp might
> end up consuming too much memory.
There are two kinds of setupds. Those with a small tmp to hold the
sockets and tiny temp files that gather there from day to day and
those with large tmp where people put huge amounts of data.
I think that if your tmp is less than half your ram size then tmpfs is
a very good choice. After 60 days my tmp looks like this:
tmpfs 1.0G 96K 1.0G 1% /tmp
Definetly not consuming too much memory.
Note that if the tmpfs does consume too much memory then linux swaps
it out. So you should adjust the swap size accordingly. Personally I
think even on low/medium ram sized systems (say 256MB+) tmpfs is a
good choice. If ram is free then ram will be used. If not then swap is
used. If tmpfs isn't full then more swap is free for programs. You
get twice the use out of your swap as it can be used for either
But do we need this in a package? Every admin can put a line into
/etc/fstab for this if it is wanted. I think the right place to ask
for this is the Debian-Installer. Leave installed systems as is. If
people are used to having a 10G /tmp and you suddenly mount a 512MB
tmpfs they won't like it. If you mount tmpfs at install time you will
shaddow neccessary sockets (so don't). And if you only do it at the
next reboot people might be surprised by the change half a year after
they installed the package.
As for the other directories:
/var/run needs it dirs.
/var/tmp must survive reboots.
/var/run and /var/lock are too small to bother.
I wouldn't want yet another two FS entries in my df and mount
outputs. They are cluttered enough as it is. Recently /lib/init/rw
added yet another line.