]>
git.ipfire.org Git - ipfire-2.x.git/blob - src/initscripts/init.d/collectd
2 # Begin $rc_base/init.d/collecd
8 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/main
/settings
)
10 if [ "$RRDLOG" = '' ]; then
16 if [ ! -e /etc
/sysconfig
/lm_sensors
]; then
17 boot_mesg
"Searching for Sensors..."
18 "yes" |
/usr
/sbin
/sensors-detect
> /dev
/null
21 if [ ! -e /etc
/sysconfig
/lm_sensors
]; then
22 echo "#No Sensors detected " > /etc
/sysconfig
/lm_sensors
23 sed -i -e "s|^LoadPlugin sensors|#LoadPlugin sensors|g" /etc
/collectd.conf
27 if [ ! -e /sys
/class
/thermal
/thermal_zone0
]; then
28 sed -i -e "s|^LoadPlugin thermal|#LoadPlugin thermal|g" /etc
/collectd.conf
30 sed -i -e "s|^#LoadPlugin thermal|LoadPlugin thermal|g" /etc
/collectd.conf
33 if [ "$(swapon -s | wc -l)" == "1" ]; then
34 sed -i -e "s|^LoadPlugin swap|#LoadPlugin swap|g" /etc
/collectd.conf
36 sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc
/collectd.conf
40 boot_mesg
-n "Loading Sensor Modules..."
41 for modul
in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
42 modprobe
$modul > /dev
/null
2>&1;
44 boot_mesg
-n "$SUCCESS$modul$NORMAL ";
46 boot_mesg
-n "$FAILURE$modul$NORMAL ";
52 boot_mesg
"Starting Collection daemon..."
53 /usr
/sbin
/collectd
-C /etc
/collectd.conf
57 # Save the ramdisk at manual stop but not at shutdown
58 if [ "$(basename $0)" == "collectd" ]; then
59 /etc
/init.d
/tmpfs backup
61 boot_mesg
"Stopping Collection daemon..."
62 killproc
/usr
/sbin
/collectd
71 statusproc
/usr
/sbin
/collectd
75 echo "Usage: $0 {start|stop|restart|status}"
80 # End $rc_base/init.d/collectd