diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2002-12-18 07:21:31 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2002-12-18 07:21:31 +0000 |
commit | 123a5dff987469250391a65738f0d0936ecff43f (patch) | |
tree | 544002cddae912b2585aae80dba0593c50f28a78 /etc/rc.d/bgfsck | |
parent | 6d967351b4dc23909e569bee7b6bea72e8dfc0c0 (diff) | |
download | src-123a5dff987469250391a65738f0d0936ecff43f.tar.gz src-123a5dff987469250391a65738f0d0936ecff43f.zip |
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.
Notes
Notes:
svn path=/head/; revision=108018
Diffstat (limited to 'etc/rc.d/bgfsck')
-rw-r--r-- | etc/rc.d/bgfsck | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/etc/rc.d/bgfsck b/etc/rc.d/bgfsck index f03247386702..86c26d3a1791 100644 --- a/etc/rc.d/bgfsck +++ b/etc/rc.d/bgfsck @@ -11,9 +11,20 @@ name="background-fsck" rcvar="background_fsck" -start_precmd="echo 'Starting background file system checks.'" -start_cmd="nice -4 fsck -B -p 2>&1 | logger -p daemon.notice &" +start_cmd="bgfsck_start" stop_cmd=":" +bgfsck_start () +{ + 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 & +} + load_rc_config $name run_rc_command "$1" |