#! /bin/sh # # smartd Start/Stop the smartd daemon. # # chkconfig: 2345 40 60 # description: Self Monitoring and Reporting Technology (S.M.A.R.T.) Daemon \ # monitors the reliability of ATA and SCSI hard drives. # processname: smartd # config: /etc/smartd.conf # pidfile: /var/run/smartd.pid # Source function library . /etc/init.d/functions # Get config. SourceIfNotEmpty /etc/sysconfig/smartd SMARTD=/usr/sbin/smartd LOCKFILE=/var/lock/subsys/smartd PIDFILE=/var/run/smartd.pid RETVAL=0 start() { echo -n "Starting smartd: " daemon $SMARTD "-p $PIDFILE $EXTRAOPTIONS" RETVAL=$? echo [ $RETVAL -eq 0 ] && touch "$LOCKFILE" return $RETVAL } stop() { echo -n "Stopping smartd: " killproc smartd RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f "$LOCKFILE" return $RETVAL } restart() { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condstop) if [ -e "$LOCKFILE" ]; then stop fi ;; condrestart) if [ -e "$LOCKFILE" ]; then restart fi ;; status) status smartd RETVAL=$? ;; *) echo "Usage: ${0##*/} {start|stop|restart|reload|condstop|condrestart|status}" RETVAL=1 esac exit $RETVAL