]>
git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/initscripts/init.d/collectd
96cb816d7a81adf489a9824a067be7a63fc77a1f
2 # Begin $rc_base/init.d/collecd
8 eval $
(/usr
/local
/bin
/readhash
/var
/ipfire
/main
/settings
)
12 if [ ! -e /etc
/sysconfig
/lm_sensors
]; then
13 boot_mesg
"Searching for Sensors..."
14 "yes" |
/usr
/sbin
/sensors-detect
> /dev
/null
17 if [ ! -e /etc
/sysconfig
/lm_sensors
]; then
18 echo "#No Sensors detected " > /etc
/sysconfig
/lm_sensors
19 sed -i -e "s|LoadPlugin sensors|#LoadPlugin sensors|g" /etc
/collectd.conf
23 if [ ! -e $RRDLOG.bak
/ ]; then
27 /etc
/init.d
/collectd restore
29 boot_mesg
-n "Loading Sensor Modules..."
30 for modul
in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
31 modprobe
$modul > /dev
/null
2>&1;
33 boot_mesg
-n "$SUCCESS$modul$NORMAL ";
35 boot_mesg
-n "$FAILURE$modul$NORMAL ";
41 boot_mesg
"Starting Collection daemon..."
42 /usr
/sbin
/collectd
-C /etc
/collectd.conf
46 /etc
/init.d
/collectd backup
47 boot_mesg
"Stopping Collection daemon..."
48 killproc
/usr
/sbin
/collectd
57 boot_mesg
"Save rrd files from ramd..."
58 cp -pR $RRDLOG/* $RRDLOG.bak
/
62 boot_mesg
"Copying rrd files to ramd..."
63 cp -pR $RRDLOG.bak
/* $RRDLOG/
66 statusproc
/usr
/sbin
/collectd
70 echo "Usage: $0 {start|stop|restart|status}"
75 # End $rc_base/init.d/collectd