From 385a585a4bc1493cbd873a13f3b9d8919dab5ef4 Mon Sep 17 00:00:00 2001 From: Doug Barton Date: Mon, 5 Feb 2001 04:54:42 +0000 Subject: [PATCH] Introduce the option of running fsck -y if the initial preen fails. Defaults to off. Obtained from: Yahoo! --- etc/defaults/rc.conf | 1 + etc/rc | 20 ++++++++++++++++++-- share/man/man5/rc.conf.5 | 8 +++++++- 3 files changed, 26 insertions(+), 3 deletions(-) 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 ,