[Pkg-sysvinit-devel] Bug#665995: fstab actually not overriding RAMTMP ?

J M Cerqueira Esteves jmce at artenumerica.com
Sun Apr 15 12:32:52 UTC 2012


According to Roger Leigh <rleigh at codelibre.net>

> The RAMTMP setting only has an effect when there are no fstab
> entries--the fstab entry (if any) will override the RAMTMP setting.

but it seems /etc/rcS.d/S01mountkernfs.sh actually only lets fstab
override RAMTMP when it has a tmpfs entry for /tmp:

1) When root is read-only, RAMTMP is forced to "yes" when there's an
fstab entry, but existence of a fstab entry doesn't force RAMTMP to be "no":
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# If root is read only, default to mounting a tmpfs on /tmp,
# unless one is due to be mounted from fstab.
if [ rw != "$rootmode" ]; then
   # If there's an entry in fstab for /tmp (any
   # filesystem type, not just tmpfs), then we don't need
   # a tmpfs on /tmp by default.
   if read_fstab_entry /tmp ; then
      :
   else
      RAMTMP="yes"
   fi
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

2) After the above, if RAMTMP is "yes" it is only overriden by a fstab
entry with /tmp as tmpfs:

# Mount /tmp as tmpfs if enabled.
if [ yes = "$RAMTMP" ] || read_fstab_entry /tmp tmpfs; then
  domount "$MNTMODE" tmpfs shmfs /tmp tmpfs "-onodev,nosuid$TMP_OPT"


In my recently installed Wheezy machine, the end effect is that I have
two /tmp mounts, both with the same size (wondering why the size is the
same... or maybe I failed to understand something)

J Esteves


-- 
+351 939838775   skype:jmcerqueira
http://twitter.com/jmcest  http://trunk.ly/jmce
http://identi.ca/jmcest    http://log.jmce.eu/





More information about the Pkg-sysvinit-devel mailing list