opt/smartmontools/smartd

40 lines
697 B
Plaintext
Raw Normal View History

2006-04-10 14:43:50 +02:00
#!/bin/sh
#
# /etc/rc.d/smartd: start/stop smartd daemon
#
2015-04-13 18:57:44 +02:00
SSD=/sbin/start-stop-daemon
PROG=/usr/sbin/smartd
2022-02-17 17:02:49 +01:00
PID=/run/smartd.pid
2015-04-13 18:57:44 +02:00
OPTS="-p $PID"
2006-04-10 14:43:50 +02:00
case $1 in
start)
2015-04-13 18:57:44 +02:00
$SSD --start --pidfile $PID --exec $PROG -- $OPTS
2006-04-10 14:43:50 +02:00
;;
stop)
2015-04-13 18:57:44 +02:00
$SSD --stop --retry 10 --pidfile $PID
2006-04-10 14:43:50 +02:00
;;
restart)
$0 stop
$0 start
;;
reload)
2015-04-13 18:57:44 +02:00
$SSD --stop --pidfile $PID --signal HUP
;;
status)
$SSD --status --pidfile $PID
case $? in
0) echo "$PROG is running with pid $(cat $PID)" ;;
1) echo "$PROG is not running but the pid file $PID exists" ;;
3) echo "$PROG is not running" ;;
4) echo "Unable to determine the program status" ;;
esac
2006-04-10 14:43:50 +02:00
;;
*)
2015-04-13 18:57:44 +02:00
echo "usage: $0 [start|stop|restart|reload|status]"
2006-04-10 14:43:50 +02:00
;;
esac
# End of file