2002-06-13 22:14:37 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: bgfsck
|
|
|
|
# REQUIRE: cron devfs
|
|
|
|
# KEYWORD: FreeBSD
|
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="background-fsck"
|
|
|
|
rcvar="background_fsck"
|
2002-12-18 07:21:31 +00:00
|
|
|
start_cmd="bgfsck_start"
|
2002-06-13 22:14:37 +00:00
|
|
|
stop_cmd=":"
|
|
|
|
|
2002-12-18 07:21:31 +00:00
|
|
|
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 | \
|
2003-04-23 15:38:02 +00:00
|
|
|
logger -p daemon.notice -t fsck &
|
2002-12-18 07:21:31 +00:00
|
|
|
}
|
|
|
|
|
2002-06-13 22:14:37 +00:00
|
|
|
load_rc_config $name
|
|
|
|
run_rc_command "$1"
|