aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2008-01-10 20:31:42 +0000
committerBill Nottingham <notting@redhat.com>2008-01-10 20:31:42 +0000
commit91a777e0d3e50fa0717853a9f67dfee5c35b7344 (patch)
tree010b08ae01fcdbdc0469a2af02735f06b2552c3f
parent473a1b7e6a0069db4e4973a732588cd7e911cffe (diff)
downloadinitscripts-91a777e0d3e50fa0717853a9f67dfee5c35b7344.tar
initscripts-91a777e0d3e50fa0717853a9f67dfee5c35b7344.tar.gz
initscripts-91a777e0d3e50fa0717853a9f67dfee5c35b7344.tar.bz2
initscripts-91a777e0d3e50fa0717853a9f67dfee5c35b7344.tar.xz
initscripts-91a777e0d3e50fa0717853a9f67dfee5c35b7344.zip
fix root fs check to catch 'rw,ordered,noatime,etc.' properly (#334171)
-rwxr-xr-xrc.d/rc.sysinit20
1 files changed, 18 insertions, 2 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index eda79ffa..ea9c6884 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -703,11 +703,27 @@ if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
action $"Checking local filesystem quotas: " /sbin/quotacheck -aRnug
fi
+remount_needed() {
+ local state oldifs
+ [ "$READONLY" = "yes" ] && return 1
+ state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
+ oldifs=$IFS
+ IFS=","
+ for opt in $state ; do
+ if [ "$opt" = "rw" ]; then
+ IFS=$oldifs
+ return 1
+ fi
+ done
+ IFS=$oldifs
+ return 0
+}
+
# Remount the root filesystem read-write.
update_boot_stage RCmountfs
-state=`LC_ALL=C awk '/ \/ / && ($3 !~ /rootfs/) { print $4 }' /proc/mounts`
-[ "$state" != "rw" -a "$READONLY" != "yes" ] && \
+if remount_needed ; then
action $"Remounting root filesystem in read-write mode: " mount -n -o remount,rw /
+fi
# Clean up SELinux labels
if [ -n "$SELINUX_STATE" ]; then