#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-apps/smartmontools/files/smartd.rc,v 1.3 2004/09/03 12:00:00 agriffis Exp $ opts="${opts} reload" [ -z "${PIDFILE}" ] && PIDFILE=/var/run/smartd.pid depend() { need localmount } checkconfig() { if [ ! -f "/etc/smartd.conf" ] ; then eerror "You should setup your /etc/smartd.conf file!" eerror "See sample conf: /etc/smartd.conf.example" fi } start() { checkconfig || return 1 ebegin "Starting S.M.A.R.T. monitoring daemon" start-stop-daemon --start --exec /usr/sbin/smartd \ -- -p ${PIDFILE} ${SMARTD_OPTS} eend $? } stop() { ebegin "Stopping S.M.A.R.T. monitoring daemon" start-stop-daemon --stop --exec /usr/sbin/smartd eend $? } reload(){ if [ ! -f /var/run/smartd.pid ]; then eerror "S.M.A.R.T. monitoring daemon isn't running" return 1 fi ebegin "Reloading configuration" killall -HUP smartd &>/dev/null eend $? }