Bug 12039 - Mounting probs (/var/shm)
Mounting probs (/var/shm)
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-06-09 19:23 EDT by SB
Modified: 2014-03-16 22:14 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2000-06-16 21:47:14 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description SB 2000-06-09 19:23:39 EDT
I'm sure if this is a bug or intended but /var/shm which 
is mounted near the top of /etc/rc.d/rc.sysinit: 

# Mount shm - ignore errors because the only "error" that can occur is
# a kernel < 2.3.99 which doesn't require /var/shm
mount -t shm none /var/shm &>/dev/null || :

is never unmounted at shutdown or reboot.  I know this only 
applies to 2.3.99+ kernels but that is what I am currently using 
anyway.  If indeed it should be unmounted the lines that
prevent it from being unmounted are in the halt and reboot
scripts in lines like this:
remaining=`awk '!/(^#|proc|loopfs|^none|^\/dev\/root| \/ )/ {print $2}' 

The virtual /proc/mounts file shows /var/shm and /dev as:
none /dev devfs rw 0 0
none /var/shm shm rw 0 0

Thus the none filtered out by the awk statement prevents those
two from being unmounted, as far as I can tell.  .  /dev is 
unmounted when devfsd is shutdown, but /var/shm is not mounted
by a daemon and therefore does not get unmounted.  If this is 
indeed a real problem I would love a fix as I am having unmounting at
shutdown which may be related.  And FYI shm should be unmounted
before the devfs filesystem is unmounted because in kernel 2.4.0-test1
pre-releases /var/shm is moved to /dev/shm so it can be handled by

I think the mounting handling of virtual shared memory filesystem
should be done outside of rc.sysinit in /etc/fstab as the kernel
documentation recommends. Adding a line like:

none     /dev/shm         shm       defaults         0 0

should do the trick.  It makes sure the shm file system gets mounted
and unmounted and it gets rid of needless work in rc.sysinit and
also saves the troubling of editing the halt and reboot scripts to
handle it differently.

-Stan Bubrouski
Comment 1 compwiz 2000-06-16 21:47:14 EDT
I don't think /var/shm needs to be unmounted at shutdown.. Also, the newest RPM
of initscripts moves shm to /dev/shm.

Note You need to log in before you can comment on or make changes to this bug.