Does anybody object to adding a background_fsck rc.conf option to
facilitate easy switching of background fsck on or off? Robert Watson
suggested this on cvs-all some time ago, but the discussion drifted
off. Attached is a very short patch to implement it; it basically
makes rev. 1.263 of src/etc/rc conditional on ${background_fsck}. The
patch leaves background fsck on by default, but now that can be easily
changed; I'm sure there will be a long thread about what the default
should be later.
Comments? Suggestions?
Thanks,
Dima Dorfman
[EMAIL PROTECTED]
Index: etc/rc
===================================================================
RCS file: /stl/src/FreeBSD/src/etc/rc,v
retrieving revision 1.264
diff -u -r1.264 rc
--- etc/rc 2001/05/13 20:43:30 1.264
+++ etc/rc 2001/05/21 00:19:25
@@ -184,9 +184,14 @@
case ${bootmode} in
autoboot)
echo 'Automatic boot in progress...'
-# To restore old fsck behavior use:
-# fsck -p
- fsck -F -p
+ case ${background_fsck} in
+ [Yy][Ee][Ss])
+ fsck -F -p
+ ;;
+ *)
+ fsck -p
+ ;;
+ esac
case $? in
0)
;;
@@ -810,9 +815,13 @@
;;
esac
-# Start background fsck checks
-echo 'Starting background filesystem checks'
-nice -4 fsck -B -p 2>&1 | logger -p daemon.notice &
+# Start background fsck checks if necessary
+case ${background_fsck} in
+[Yy][Ee][Ss])
+ echo 'Starting background filesystem checks'
+ nice -4 fsck -B -p 2>&1 | logger -p daemon.notice &
+ ;;
+esac
echo ''
Index: etc/defaults/rc.conf
===================================================================
RCS file: /stl/src/FreeBSD/src/etc/defaults/rc.conf,v
retrieving revision 1.105
diff -u -r1.105 rc.conf
--- etc/defaults/rc.conf 2001/05/14 20:51:03 1.105
+++ etc/defaults/rc.conf 2001/05/21 00:19:25
@@ -33,6 +33,7 @@
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.
+background_fsck="YES" # Attempt to run fsck in the background where possible.
##############################################################
### Network configuration sub-section ######################
Index: share/man/man5/rc.conf.5
===================================================================
RCS file: /stl/src/FreeBSD/src/share/man/man5/rc.conf.5,v
retrieving revision 1.104
diff -u -r1.104 rc.conf.5
--- share/man/man5/rc.conf.5 2001/05/15 15:52:55 1.104
+++ share/man/man5/rc.conf.5 2001/05/21 00:19:25
@@ -625,6 +625,13 @@
.Xr fsck 8
will be run with the -y flag if the initial preen
of the filesystems fails.
+.It Va background_fsck
+.Pq Vt bool
+if set to
+.Ar YES ,
+the system will attempt to run
+.Xr fsck 8
+in the background where possible.
.It Va syslogd_enable
.Pq Vt bool
If set to
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message