diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf index 7fd9a5272cde..6e2775a2e622 100644 --- a/etc/defaults/rc.conf +++ b/etc/defaults/rc.conf @@ -31,6 +31,7 @@ pccardd_flags="" # Additional flags for pccardd. pccard_conf="/etc/defaults/pccard.conf" # pccardd(8) config file local_startup="/usr/local/etc/rc.d /usr/X11R6/etc/rc.d" # startup script dirs. rc_conf_files="/etc/rc.conf /etc/rc.conf.local" +fsck_y_enable="NO" # Set to YES to do fsck -y if the initial preen fails. ############################################################## ### Network configuration sub-section ###################### diff --git a/etc/rc b/etc/rc index fefeed38d506..3155f34a4e24 100644 --- a/etc/rc +++ b/etc/rc @@ -157,8 +157,24 @@ autoboot) exit 1 ;; 8) - echo 'Automatic file system check failed... help!' - exit 1 + case ${fsck_y_enable} in + [Yy][Ee][Ss]) + echo 'File system preen failed, trying fsck -y . . .' + fsck -y + case $? in + 0) + ;; + *) + echo 'Automatic file system check failed . . . help!' + exit 1 + ;; + esac + ;; + *) + echo 'Automatic file system check failed . . . help!' + exit 1 + ;; + esac ;; 12) echo 'Reboot interrupted' diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 1f7d16f7ed50..15389e732eb3 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2000 +.Dd February 4, 2001 .Dt RC.CONF 5 .Os .Sh NAME @@ -575,6 +575,12 @@ By default, the files specified are .Pa /etc/rc.conf and .Pa /etc/rc.conf.local +.It Ar fsck_y_enable +(bool) if set to +.Ar YES , +.Xr fsck 8 +will be run with the -y flag if the initial preen +of the filesystems fails. .It Ar syslogd_enable (bool) If set to .Ar YES ,