#!/bin/sh # chkconfig: 2345 40 40 # description: Self Monitoring and Reporting Technology (SMART) Daemon # processname: smartd ### BEGIN INIT INFO # Provides: smartd # Required-Start: $syslog # X-UnitedLinux-Should-Start: $sendmail # Should-Start: $sendmail # Required-Stop: $syslog # Default-Start: 2 3 5 # Default-Stop: # Short-Description: Monitors disk and tape health via S.M.A.R.T. # Description: Start S.M.A.R.T. disk and tape monitor. ### END INIT INFO # Source function library . /etc/rc.d/init.d/functions # Source configuration file [ -r /etc/sysconfig/smartd ] && . /etc/sysconfig/smartd RETVAL=0 prog=smartd case "$1" in start) echo -n $"Starting $prog: " daemon /usr/sbin/smartd $SMARTD_OPTIONS RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog ;; stop) echo -n $"Shutting down $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog ;; reload) echo -n $"Reloading $prog daemon configuration: " killproc $prog -HUP RETVAL=$? echo ;; report) echo -n $"Checking SMART devices now: " killproc $prog -USR1 RETVAL=$? echo ;; restart) $0 stop $0 start ;; status) status $prog ;; *) echo $"Usage: $0 {start|stop|reload|report|restart|status}" RETVAL=1 ;; esac exit $RETVAL