]>
git.ipfire.org Git - people/pmueller/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 $RRDLOG.bak
/ ]; then
31 /etc
/init.d
/collectd restore
33 boot_mesg
-n "Loading Sensor Modules..."
34 for modul
in `cat /etc/sysconfig/lm_sensors | grep '^MODULE_' | cut -d"=" -s -f2`; do
35 modprobe
$modul > /dev
/null
2>&1;
37 boot_mesg
-n "$SUCCESS$modul$NORMAL ";
39 boot_mesg
-n "$FAILURE$modul$NORMAL ";
45 boot_mesg
"Starting Collection daemon..."
46 /usr
/sbin
/collectd
-C /etc
/collectd.conf
50 /etc
/init.d
/collectd backup
51 boot_mesg
"Stopping Collection daemon..."
52 killproc
/usr
/sbin
/collectd
61 boot_mesg
"Save rrd files from ramd..."
62 cp -pR $RRDLOG/* $RRDLOG.bak
/
66 if [ -e $RRDLOG.bak
];then
67 boot_mesg
"Copying rrd files to ramd..."
68 cp -pR $RRDLOG.bak
/* $RRDLOG/
72 statusproc
/usr
/sbin
/collectd
76 echo "Usage: $0 {start|stop|restart|status}"
81 # End $rc_base/init.d/collectd