2004-04-28 20:27:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
# PROVIDE: smartd
|
|
|
|
# REQUIRE: DAEMON
|
|
|
|
# BEFORE: LOGIN
|
2006-02-20 21:47:50 +01:00
|
|
|
# KEYWORD: shutdown
|
2004-04-28 20:27:52 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
|
#
|
2006-01-07 07:29:57 +01:00
|
|
|
smartd_enable="${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
|
|
|
|
2010-03-27 01:15:24 +01:00
|
|
|
. /etc/rc.subr
|
2004-04-28 20:27:52 +02:00
|
|
|
|
|
|
|
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"}
|
2005-11-18 12:46:38 +01:00
|
|
|
: ${smartd_flags="-c ${smartd_config}"}
|
2005-11-17 23:04:25 +01:00
|
|
|
|
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"
|