summaryrefslogtreecommitdiffstats
path: root/etc/rc
diff options
context:
space:
mode:
authormckusick <mckusick@FreeBSD.org>2002-12-18 07:21:31 +0000
committermckusick <mckusick@FreeBSD.org>2002-12-18 07:21:31 +0000
commit18817ccf4429c1df4380877beeff31ae72b98f2a (patch)
tree544002cddae912b2585aae80dba0593c50f28a78 /etc/rc
parentf86b91ebe0dbbca444d3faa3983386c238d9fa53 (diff)
downloadFreeBSD-src-18817ccf4429c1df4380877beeff31ae72b98f2a.zip
FreeBSD-src-18817ccf4429c1df4380877beeff31ae72b98f2a.tar.gz
Delay an optional amount of time after booting before starting a
background fsck. The delay defaults to sixty seconds to allow large applications such as the X server to start before disk I/O bandwidth is monopolized by fsck. Submitted by: Brooks Davis <brooks@one-eyed-alien.net> Sponsored by: DARPA & NAI Labs.
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc10
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/rc b/etc/rc
index 20a8414..636fdbc 100644
--- a/etc/rc
+++ b/etc/rc
@@ -982,8 +982,14 @@ esac
# 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 &
+ bgfsck_msg='Starting background file system checks'
+ if [ ${background_fsck_delay:=0} -gt 0 ]; then
+ bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds"
+ fi
+ echo "${bgfsck_msg}."
+
+ (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \
+ logger -p daemon.notice &
;;
esac
OpenPOWER on IntegriCloud