summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-15 08:39:37 +0000
committerdg <dg@FreeBSD.org>1995-05-15 08:39:37 +0000
commit138edd5273d35e08da6e845209e7dd80fe77924c (patch)
tree82764c969eb66004d43f1587e1a92f6384536acb /etc/rc
parent4c12c11b834683a92600a2ef20fabca71b3448ef (diff)
downloadFreeBSD-src-138edd5273d35e08da6e845209e7dd80fe77924c.zip
FreeBSD-src-138edd5273d35e08da6e845209e7dd80fe77924c.tar.gz
Fixed incompleteness that would allow dirty filesystems to get mounted
when the single user shell was terminated. These changes disallow mounting or R/W upgrading filesystems that are dirty unless "-f" (force) option is used with mount. /etc/rc has been modified to abort the startup if one or more non-nfs partitions fail to mount. Reviewed by: Poul-Henning Kamp, Rod Grimes
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/rc b/etc/rc
index 61fb546..33a4cda 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: rc,v 1.63 1995/04/11 18:36:10 ache Exp $
+# $Id: rc,v 1.64 1995/05/11 21:11:17 jkh Exp $
# From: @(#)rc 5.27 (Berkeley) 6/5/91
# System startup script run by init on autoboot
@@ -65,9 +65,18 @@ trap "echo 'Reboot interrupted'; exit 1" 3
# root must be read/write both for NFS diskless and for VFS LKMs before
# proceeding any further.
mount -u -o rw /
+if [ $? != 0 ]; then
+ echo "Filesystem mount failed, startup aborted"
+ exit 1
+fi
umount -a >/dev/null 2>&1
+
mount -a -t nonfs
+if [ $? != 0 ]; then
+ echo "Filesystem mount failed, startup aborted"
+ exit 1
+fi
# If the machine runs wall CMOS clock (compatible with MSDOS),
# activate following line by creating empty file /etc/wall_cmos_clock
OpenPOWER on IntegriCloud