]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blame - src/initscripts/init.d/collectd
Workaround a bug in vnstati if vnstat give nan%
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / collectd
CommitLineData
a332b303
CS
1#!/bin/sh
2# Begin $rc_base/init.d/collecd
3
4
5. /etc/sysconfig/rc
6. $rc_functions
7
8case "$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#
7bf4d18c
AF
23# boot_mesg "Bringing up mbmon daemon..."
24# /usr/bin/mbmon -P 411 -r
25# evaluate_retval
26
a332b303
CS
27 ;;
28
29 stop)
9f663e66
CS
30# if mbmon is not running on your system, we advise to comment out these lines
31# in order to prevent fail
32 boot_mesg "Stopping mbmon daemon..."
33 killproc /usr/bin/mbmon
34 evaluate_retval
a332b303
CS
35# boot_mesg "Stopping hddtemp daemon..."
36# killproc /usr/sbin/hddtemp
37# evaluate_retval
38 boot_mesg "Stopping Collection daemon..."
39 killproc /usr/sbin/collectd
40 evaluate_retval
41 ;;
42
43 restart)
9f663e66
CS
44
45#
46# We need to do this that way because mbmon doesn`t clear the port when killed
47# so the next startup it fails with port allready in use -> donĀ“t restart mbmon
48#
49 boot_mesg "Stopping Collection daemon..."
50 killproc /usr/sbin/collectd
51 evaluate_retval
a332b303 52 sleep 1
9f663e66
CS
53 boot_mesg "Starting Collection daemon..."
54 /usr/sbin/collectd -C /etc/collectd.conf
a332b303
CS
55 evaluate_retval
56 ;;
57
58 status)
59 statusproc /usr/sbin/collectd
60 ;;
61
62 *)
63 echo "Usage: $0 {start|stop|restart|status}"
64 exit 1
65 ;;
66esac
67
68# End $rc_base/init.d/collectd