Bug 12039 - Mounting probs (/var/shm)
Summary: Mounting probs (/var/shm)
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: initscripts
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-09 23:23 UTC by SB
Modified: 2014-03-17 02:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-06-17 01:47:14 UTC
Embargoed:


Attachments (Terms of Use)

Description SB 2000-06-09 23:23:39 UTC
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}' 
/proc/mounts`

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
devfsd.

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-17 01:47:14 UTC
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.