aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d/rc.sysinit
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2008-09-16 10:23:22 +0200
committerHarald Hoyer <harald@redhat.com>2008-09-16 10:38:10 +0200
commit941a2a83127f206aa46c0e55cc57eada091c7abe (patch)
treeac107299def96bfd60aab71cdfdcaf69c5f5b5eb /rc.d/rc.sysinit
parent58ddef0ad76b02840d6cf8babb0d036f1a1f1c83 (diff)
downloadinitscripts-941a2a83127f206aa46c0e55cc57eada091c7abe.tar
initscripts-941a2a83127f206aa46c0e55cc57eada091c7abe.tar.gz
initscripts-941a2a83127f206aa46c0e55cc57eada091c7abe.tar.bz2
initscripts-941a2a83127f206aa46c0e55cc57eada091c7abe.tar.xz
initscripts-941a2a83127f206aa46c0e55cc57eada091c7abe.zip
https://bugzilla.redhat.com/show_bug.cgi?id=433702
Changes to init scripts to better support stateless: --rc.sysinit-- - don't update mtab in a r/o root - mount on sys and /dev/pts returns EBUSY on a readonly root - [ -n $CLIENTSTATE ] is always returning true, causing an unnecessary timeout --network-- - /etc/mtab may not have any mount information in the readonly-root cause, but the root mount is likely to be a network mount. Without this, nfs hangs the reboot process. --halt-- - don't try and update a read-only mtab --rwtab-- - /var/empty/sshd/etc/localtime needs to be overwritten by sshd at startup - /var/lib/random-seed is written to at shutdown; this fixes the error but doesn't return the functionality lost in a r/o /var/lib.
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-xrc.d/rc.sysinit30
1 files changed, 18 insertions, 12 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit
index ea9c6884..7f28783b 100755
--- a/rc.d/rc.sysinit
+++ b/rc.d/rc.sysinit
@@ -595,7 +595,7 @@ if [ "$READONLY" = "yes" -o "$TEMPORARY_STATE" = "yes" ]; then
/bin/true
elif [ x$state_mount_dev != x ] && mount $state_mount_dev $mountopts "$STATE_MOUNT" > /dev/null 2>&1; then
/bin/true
- elif [ -n "$CLIENTSTATE" ]; then
+ elif [ ! -z "$CLIENTSTATE" ]; then
# No local storage was found. Make a final attempt to find
# state on an NFS server.
@@ -730,23 +730,29 @@ if [ -n "$SELINUX_STATE" ]; then
restorecon /etc/mtab /etc/ld.so.cache /etc/blkid/blkid.tab /etc/resolv.conf >/dev/null 2>&1
fi
-# Clear mtab
-(> /etc/mtab) &> /dev/null
+if [ "$READONLY" != "yes" ] ; then
+ # Clear mtab
+ (> /etc/mtab) &> /dev/null
-# Remove stale backups
-rm -f /etc/mtab~ /etc/mtab~~
+ # Remove stale backups
+ rm -f /etc/mtab~ /etc/mtab~~
-# Enter mounted filesystems into /etc/mtab
-mount -f /
-mount -f /proc >/dev/null 2>&1
-mount -f /sys >/dev/null 2>&1
-mount -f /dev/pts >/dev/null 2>&1
-mount -f /proc/bus/usb >/dev/null 2>&1
+ # Enter mounted filesystems into /etc/mtab
+ mount -f /
+ mount -f /proc >/dev/null 2>&1
+ mount -f /sys >/dev/null 2>&1
+ mount -f /dev/pts >/dev/null 2>&1
+ mount -f /proc/bus/usb >/dev/null 2>&1
+fi
# 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 [ "$READONLY" != "yes" ] ; then
+ action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
+else
+ action $"Mounting local filesystems: " mount -a -n -t nfs4,smbfs,ncpfs,cifs,gfs -O no_netdev
+fi
if [ -x /sbin/quotaon ]; then
action $"Enabling local filesystem quotas: " /sbin/quotaon -aug