blob: 44ff56947ed0c237351c0e7ac7759f6d10fcada7 (
plain)
1 #!/bin/sh
2 #
3 # /etc/rc.d/smartd: start/stop smartd daemon
4 #
5
6 SSD=/sbin/start-stop-daemon
7 PROG=/usr/sbin/smartd
8 PID=/run/smartd.pid
9 OPTS="-p $PID"
10
11 case $1 in
12 start)
13 $SSD --start --pidfile $PID --exec $PROG -- $OPTS
14 ;;
15 stop)
16 $SSD --stop --retry 10 --pidfile $PID
17 ;;
18 restart)
19 $0 stop
20 $0 start
21 ;;
22 reload)
23 $SSD --stop --pidfile $PID --signal HUP
24 ;;
25 status)
26 $SSD --status --pidfile $PID
27 case $? in
28 0) echo "$PROG is running with pid $(cat $PID)" ;;
29 1) echo "$PROG is not running but the pid file $PID exists" ;;
30 3) echo "$PROG is not running" ;;
31 4) echo "Unable to determine the program status" ;;
32 esac
33 ;;
34 *)
35 echo "usage: $0 [start|stop|restart|reload|status]"
36 ;;
37 esac
38
39 # End of file
|