]>
Commit | Line | Data |
---|---|---|
a332b303 CS |
1 | #!/bin/sh |
2 | # Begin $rc_base/init.d/collecd | |
3 | ||
4 | ||
5 | . /etc/sysconfig/rc | |
6 | . $rc_functions | |
7 | ||
8 | case "$1" in | |
9 | start) | |
10 | boot_mesg "Starting Collection daemon..." | |
11 | /usr/sbin/collectd -C /etc/collectd.conf | |
12 | evaluate_retval | |
9f663e66 CS |
13 | # |
14 | # These lines are for furhter implementation of the collectd, atm the temps are | |
15 | # collected by the makegraphs script because of the standby functions | |
16 | # | |
a332b303 | 17 | # for disk in `kudzu -qps -c HD | grep device: | cut -d" " -f2 | sort | uniq`; do boot_mesg "Bringing up hddtemp daemon for $disk ..."; /usr/sbin/hddtemp $disk -d -l localhost; evaluate_retval; done |
9f663e66 CS |
18 | # |
19 | # Starting the mbmon in deamon mode to enable sensors reading for collectd | |
20 | # later mbmon will be replaced by lmsensors, if mbmon is not running on your | |
21 | # system, we advise to comment out these lines in order to prevent fail | |
22 | # | |
4a52eae4 CS |
23 | boot_mesg "Bringing up mbmon daemon..." |
24 | /usr/bin/mbmon -P 411 -r | |
9f663e66 | 25 | evaluate_retval |
a332b303 CS |
26 | ;; |
27 | ||
28 | stop) | |
9f663e66 CS |
29 | # if mbmon is not running on your system, we advise to comment out these lines |
30 | # in order to prevent fail | |
31 | boot_mesg "Stopping mbmon daemon..." | |
32 | killproc /usr/bin/mbmon | |
33 | evaluate_retval | |
a332b303 CS |
34 | # boot_mesg "Stopping hddtemp daemon..." |
35 | # killproc /usr/sbin/hddtemp | |
36 | # evaluate_retval | |
37 | boot_mesg "Stopping Collection daemon..." | |
38 | killproc /usr/sbin/collectd | |
39 | evaluate_retval | |
40 | ;; | |
41 | ||
42 | restart) | |
9f663e66 CS |
43 | |
44 | # | |
45 | # We need to do this that way because mbmon doesn`t clear the port when killed | |
46 | # so the next startup it fails with port allready in use -> donĀ“t restart mbmon | |
47 | # | |
48 | boot_mesg "Stopping Collection daemon..." | |
49 | killproc /usr/sbin/collectd | |
50 | evaluate_retval | |
a332b303 | 51 | sleep 1 |
9f663e66 CS |
52 | boot_mesg "Starting Collection daemon..." |
53 | /usr/sbin/collectd -C /etc/collectd.conf | |
a332b303 CS |
54 | evaluate_retval |
55 | ;; | |
56 | ||
57 | status) | |
58 | statusproc /usr/sbin/collectd | |
59 | ;; | |
60 | ||
61 | *) | |
62 | echo "Usage: $0 {start|stop|restart|status}" | |
63 | exit 1 | |
64 | ;; | |
65 | esac | |
66 | ||
67 | # End $rc_base/init.d/collectd |