summaryrefslogtreecommitdiffstats
path: root/abs/extra/lm_sensors/healthd.rc
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2010-08-30 22:26:00 (GMT)
committerJames Meyer <james.meyer@operamail.com>2010-08-30 22:26:00 (GMT)
commit1f175a7b07b9553ce98d0546ac04dbb925ec0bc9 (patch)
treec969070115611a8a75f23d468aa5e0cf86a08121 /abs/extra/lm_sensors/healthd.rc
parentc4bd4457b5d640e1c8f5afbca7cd54c53691e5fc (diff)
downloadlinhes_pkgbuild-1f175a7b07b9553ce98d0546ac04dbb925ec0bc9.zip
linhes_pkgbuild-1f175a7b07b9553ce98d0546ac04dbb925ec0bc9.tar.gz
linhes_pkgbuild-1f175a7b07b9553ce98d0546ac04dbb925ec0bc9.tar.bz2
RESYNC EXTRA:
synced extra-testing -> extra repo Signed-off-by: James Meyer <james.meyer@operamail.com>
Diffstat (limited to 'abs/extra/lm_sensors/healthd.rc')
-rw-r--r--abs/extra/lm_sensors/healthd.rc52
1 files changed, 52 insertions, 0 deletions
diff --git a/abs/extra/lm_sensors/healthd.rc b/abs/extra/lm_sensors/healthd.rc
new file mode 100644
index 0000000..7bb7951
--- /dev/null
+++ b/abs/extra/lm_sensors/healthd.rc
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+#
+# /etc/rc.d/healthd
+#
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/healthd
+
+maybe_alarm_reset() {
+ case "${ALARM_RESET}" in
+ yes) /usr/bin/sensors > /dev/null
+ ;;
+ no) true
+ ;;
+ *) false
+ esac
+ return $?
+}
+
+PID=$(pidof -x -o %PPID /usr/sbin/healthd)
+case "${1}" in
+ start)
+ stat_busy "Starting Health Daemon"
+ [ -z "${PID}" ] && maybe_alarm_reset && /usr/sbin/healthd &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ echo "${PID}" > /var/run/healthd.pid
+ add_daemon healthd
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Health Daemon"
+ [ ! -z "${PID}" ] && kill ${PID} &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon healthd
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *) echo "usage: $0 {start|stop|restart}"
+esac
+exit 0