]> git.pld-linux.org Git - packages/lm_sensors.git/blame_incremental - sensors.init
- up to 3.1.0
[packages/lm_sensors.git] / sensors.init
... / ...
CommitLineData
1#!/bin/sh
2#
3# sensors: Hardware sensors monitoring daemon
4#
5# Version: $Revision$
6#
7# chkconfig: 2345 32 68
8# description: Starts and stops hardware sensors monitoring daemon.
9# author: Filip Kalinski <filon@pld.org.pl>
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Get service config
15if [ -f /etc/sysconfig/sensors ]; then
16 . /etc/sysconfig/sensors
17fi
18
19start() {
20 if [ ! -f /var/lock/subsys/sensors_modules ]; then
21 msg_not_running "sensors_modules"
22 exit 6
23 fi
24
25 # Check if the service is already running?
26 if [ ! -f /var/lock/subsys/sensors ]; then
27 msg_starting "sensors daemon"
28 daemon sensord \
29 ${INTERVAL:+-i $INTERVAL} \
30 ${LOG_INTERVAL:+-l $LOG_INTERVAL} \
31 ${RRD_LOGFILE:+-r $RRD_LOGFILE} \
32 ${RRD_INTERVAL:+-t $RRD_INTERVAL} \
33 -f daemon
34
35 RETVAL=$?
36 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sensors
37 touch /var/lock/subsys/sensors
38 else
39 msg_already_running "sensors daemon"
40 fi
41}
42
43stop() {
44 if [ -f /var/lock/subsys/sensors ]; then
45 msg_stopping "sensors daemon"
46 killproc sensord
47 rm -f /var/lock/subsys/sensors
48 else
49 msg_not_running "sensors daemon"
50 fi
51}
52
53RETVAL=0
54# See how we were called.
55case "$1" in
56 start)
57 start
58 ;;
59 stop)
60 stop
61 ;;
62 status)
63 status sensors sensord
64 RETVAL=$?
65 sensors
66 ;;
67 restart|force-reload)
68 stop
69 start
70 ;;
71 *)
72 msg_usage "$0 {start|stop|restart|force-reload|status}"
73 exit 3
74esac
75
76exit $RETVAL
This page took 0.020872 seconds and 4 git commands to generate.