diff options
author | brooks <brooks@FreeBSD.org> | 2007-03-11 06:53:07 +0000 |
---|---|---|
committer | brooks <brooks@FreeBSD.org> | 2007-03-11 06:53:07 +0000 |
commit | 4d8126d1b73402521b814aa74e392053c3a4db28 (patch) | |
tree | f171f2463a91ebd5d4a1339005900f03002193ad /etc | |
parent | de9f5f66c464d865c8aaaa7e866e8e5117667274 (diff) | |
download | FreeBSD-src-4d8126d1b73402521b814aa74e392053c3a4db28.zip FreeBSD-src-4d8126d1b73402521b814aa74e392053c3a4db28.tar.gz |
Allow background_fsck_delay to be set to a negative value which delays
the background fsck indefinitely. This allows the administrator to run
it at a convenient time. To support running it from cron, the
forcestart argument now causes the fsck to start with no delay and all
output to be suppressed.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/rc.d/bgfsck | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/etc/rc.d/bgfsck b/etc/rc.d/bgfsck index 9f6bc67..19ffb71 100644 --- a/etc/rc.d/bgfsck +++ b/etc/rc.d/bgfsck @@ -16,11 +16,23 @@ stop_cmd=":" bgfsck_start () { + if [ -z "${rc_force}" ]; then + background_fsck_delay=${background_fsck_delay:=0} + else + background_fsck_delay=0 + fi + if [ ${background_fsck_delay} -lt 0 ]; then + echo "Background file system checks delayed indefinitly" + return 0 + fi + bgfsck_msg='Starting background file system checks' - if [ ${background_fsck_delay:=0} -gt 0 ]; then + if [ "${background_fsck_delay}" -gt 0 ]; then bgfsck_msg="${bgfsck_msg} in ${background_fsck_delay} seconds" fi - echo "${bgfsck_msg}." + if [ -z "${rc_force}" ]; then + echo "${bgfsck_msg}." + fi (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ logger -p daemon.notice -t fsck & |