[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Question: mount /var/run as tmpfs

[Aleksey Midenkov]
> 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.

All of these except /var/tmp/ should be possible to mount as tmpfs.
To list /tmp/ as tmpfs, just update /etc/fstab to list it as a tmpfs
mount point.  For the others, edit /etc/default/rcS and set RAMRUN and
RAMLOCK to 'yes'.  There are still some packages unable to cope with
the non-persistent subdirectories in /var/run/ and /var/lock/, but
luckily they are few.  You will have to verify that this setup work
for you.

Having /var/run/ and /var/lock/ mounted as tmpfs has been possible for
years, and is commonly done with stateless workstations and diskless
machines.  Having the same setting on servers is less tested, so you
will find that some server packages fail to create the directories
they need in /var/run/ and /var/lock/ during boot.  If one of the
packages you need fail to do this, please report the problem as a
wishlist or normal severity bug.

> This can be made in one of the appropriate debian packages and made
> configurable through debconf. The package to fit this, I think, is
> initscripts.

The support for RAMRUN and RAMLOCK went into initscripts version
2.86.ds1-23, and is currently in sid.

> How do you think, would it be appreciated? Does it potentionally
> violates some policy for the particular directory from what I
> mentioned? May be you will suggest some other directores. I want to
> know because I want to do this.

The FHS is a bit unclear about this, as some people read from it that
directories in /var/run/ and /var/lock/ should persist across reboots,
while others do not.  The FHS should probably be made clearer on this

This is not a new discussion, and I guess it will reappear later as
well.  It was discussed on debian-devel@ in august.  You probably want
to reread that discussion.  Following that discussion, I went on to
create /lib/init/rw/ as a mandatory tmpfs file system for storing
state information very early in the boot.  That was added in version
2.86.ds1-23 too.

Petter Reinholdtsen
One of the initscripts maintainers

Reply to: