diff options
author | Juergen Daubert <jue@jue.li> | 2015-04-13 18:57:44 +0200 |
---|---|---|
committer | Juergen Daubert <jue@jue.li> | 2015-04-13 18:57:44 +0200 |
commit | 40b3bd179880a84c2a6faacf780b6cbce62bd8a2 (patch) | |
tree | 3ae969880e327417f5c3d769476f0717487bfb5c | |
parent | 2760fcebfb891e64682d725dd1c6520db80ab579 (diff) | |
download | opt-40b3bd179880a84c2a6faacf780b6cbce62bd8a2.tar.gz opt-40b3bd179880a84c2a6faacf780b6cbce62bd8a2.tar.xz |
smartmontools: improved rc script
-rw-r--r-- | smartmontools/.md5sum | 2 | ||||
-rw-r--r-- | smartmontools/Pkgfile | 2 | ||||
-rw-r--r-- | smartmontools/smartd | 23 |
3 files changed, 20 insertions, 7 deletions
diff --git a/smartmontools/.md5sum b/smartmontools/.md5sum index 770440c0a..4c58c65c0 100644 --- a/smartmontools/.md5sum +++ b/smartmontools/.md5sum @@ -1,2 +1,2 @@ -482b47077510dbac2bf8ce72907ff9f8 smartd +ba7af77aa9b178ebd30766bc26aae116 smartd 2ea0c62206e110192a97b59291b17f54 smartmontools-6.3.tar.gz diff --git a/smartmontools/Pkgfile b/smartmontools/Pkgfile index dd39002ee..742337320 100644 --- a/smartmontools/Pkgfile +++ b/smartmontools/Pkgfile @@ -5,7 +5,7 @@ name=smartmontools version=6.3 -release=1 +release=2 source=(http://downloads.sourceforge.net/project/$name/$name/$version/$name-$version.tar.gz \ smartd) diff --git a/smartmontools/smartd b/smartmontools/smartd index c7c1396fa..640bbfafe 100644 --- a/smartmontools/smartd +++ b/smartmontools/smartd @@ -3,23 +3,36 @@ # /etc/rc.d/smartd: start/stop smartd daemon # +SSD=/sbin/start-stop-daemon +PROG=/usr/sbin/smartd +PID=/var/run/smartd.pid +OPTS="-p $PID" + case $1 in start) - /usr/sbin/smartd -p /var/run/smartd.pid + $SSD --start --pidfile $PID --exec $PROG -- $OPTS ;; stop) - killall -q /usr/sbin/smartd + $SSD --stop --retry 10 --pidfile $PID ;; restart) $0 stop - sleep 2 $0 start ;; reload) - kill -HUP `pidof smartd` + $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 ;; *) - echo "usage: $0 [start|stop|restart|reload]" + echo "usage: $0 [start|stop|restart|reload|status]" ;; esac |