aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2004-11-24 20:34:36 +0000
committerBill Nottingham <notting@redhat.com>2004-11-24 20:34:36 +0000
commit666ccacccbad4de6f3506c52c89ac2df309d71d2 (patch)
tree40feccaaf84c0d41a162d3fbf00db282caf1f1da
parent74517f6fedbeb00e6a500555bcbaef9be389e7d6 (diff)
downloadinitscripts-666ccacccbad4de6f3506c52c89ac2df309d71d2.tar
initscripts-666ccacccbad4de6f3506c52c89ac2df309d71d2.tar.gz
initscripts-666ccacccbad4de6f3506c52c89ac2df309d71d2.tar.bz2
initscripts-666ccacccbad4de6f3506c52c89ac2df309d71d2.tar.xz
initscripts-666ccacccbad4de6f3506c52c89ac2df309d71d2.zip
clear and repopulate mtab before mounting other filesystems (#139656)
-rwxr-xr-xrc.d/rc.sysinit34
1 files changed, 17 insertions, 17 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index 29ee33cf..6b7c57e8 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -452,18 +452,8 @@ state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
-# Mount all other filesystems (except for NFS and /proc, which is already
-# mounted). Contrary to standard usage,
-# filesystems are NOT unmounted in single user mode.
-action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
-
-if [ -x /sbin/quotaon ]; then
- action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
-fi
-
-# Clean up SELinux labels, and check to see if a full relabel is needed
+# Clean up SELinux labels
if [ -n "$SELINUX" ]; then
- [ -f /.autorelabel ] && relabel_selinux
for file in /etc/mtab /etc/ld.so.cache ; do
[ -r $file ] && restorecon $file >/dev/null 2>&1
done
@@ -475,12 +465,22 @@ fi
# Remove stale backups
rm -f /etc/mtab~ /etc/mtab~~
-# Enter root, /proc and (potentially) /proc/bus/usb into mtab.
-mount -f /
-mount -f /proc
-mount -f /sys >/dev/null 2>&1
-mount -f /dev/pts
-[ -f /proc/bus/usb/devices ] && mount -f -t usbfs usbfs /proc/bus/usb
+# Enter mounted filesystems into /etc/mtab
+mount -a -f
+
+# Mount all other filesystems (except for NFS and /proc, which is already
+# mounted). Contrary to standard usage,
+# filesystems are NOT unmounted in single user mode.
+action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
+
+if [ -x /sbin/quotaon ]; then
+ action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
+fi
+
+# Check to see if a full relabel is needed
+if [ -n "$SELINUX" -a -f /.autorelabel ]; then
+ relabel_selinux
+fi
# The root filesystem is now read-write, so we can now log
# via syslog() directly..