tmpfs for session-only data
mdz at ubuntu.com
Wed Jun 15 12:45:35 CDT 2005
On Wed, Jun 15, 2005 at 03:54:43PM +0200, Taco Witte wrote:
> In a random rush to secure my computer some time ago, I've experimented
> with using tmpfs for directories that contain data that doesn't have to
> be persistent over boots (more specifically: /var/run and /tmp). I think
> the case for /var/run is especially interesting.
> The Filesystem Hierarchy Standard specifies that /var/run is meant for
> session-specific information such as PIDs of daemons and DHCP leases. On
> boot, all files in the directory should be deleted, because information
> from previous sessions could only conflict with the current session.
> (Directories in /var/run are _not_ deleted.) If a tmpfs would be used,
> this deletion wouldn't be necessary and it would be guaranteed that
> information from previous sessions wouldn't conflict with the current
> session -- things like file ownership problems wouldn't be possible for
DHCP leases are meant to be persistent across boots; there's a bug open
about this in the Debian BTS (ifupdown). Also, the fact that directories
are not removed is significant; several packages rely on their /var/run
directories being persistent (and I believe FHS supports this).
/tmp is much more interesting; I use tmpfs for /tmp practically everywhere.
More information about the ubuntu-devel