2004-04-28 20:27:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# PROVIDE: smartd
|
|
|
|
# REQUIRE: DAEMON
|
|
|
|
# BEFORE: LOGIN
|
|
|
|
# KEYWORD: FreeBSD shutdown
|
|
|
|
|
|
|
|
# Define these smartd_* variables in one of these files:
|
|
|
|
# /etc/rc.conf
|
|
|
|
# /etc/rc.conf.local
|
|
|
|
# /etc/rc.conf.d/smartd
|
|
|
|
#
|
|
|
|
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
|
|
|
#
|
|
|
|
smartd_enable="NO"
|
2004-04-29 04:46:13 +02:00
|
|
|
smartd_pidfile="/var/run/smartd.pid"
|
2004-04-28 20:27:52 +02:00
|
|
|
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
|
|
|
|
name="smartd"
|
|
|
|
rcvar=`set_rcvar`
|
|
|
|
command="%%PREFIX%%/sbin/smartd"
|
|
|
|
|
|
|
|
load_rc_config $name
|
|
|
|
|
2005-11-17 23:04:25 +01:00
|
|
|
: ${smartd_config="%%PREFIX%%/etc/smartd.conf"}
|
|
|
|
: ${smartd_flags="--configfile=${smartd_config}"}
|
|
|
|
|
2004-07-15 16:26:07 +02:00
|
|
|
pidfile="${smartd_pidfile}"
|
2005-11-17 23:04:25 +01:00
|
|
|
required_files="${smartd_config}"
|
2004-07-15 16:26:07 +02:00
|
|
|
|
2004-04-28 20:27:52 +02:00
|
|
|
case "${smartd_flags}" in
|
|
|
|
*-p\ *)
|
|
|
|
echo "ERROR: \$smartd_flags includes -p option." \
|
|
|
|
"Please use \$smartd_pidfile instead."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
2004-04-29 04:46:13 +02:00
|
|
|
smartd_flags="-p ${pidfile} ${smartd_flags}"
|
2004-04-28 20:27:52 +02:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
run_rc_command "$1"
|