fi
fi
+ # ARM does not support to scan for sensors. In that case,
+ # we create an empty configuration file.
+ machine=$(uname -m)
+ if [ "${machine:0:3}" = "arm" ]; then
+ touch /etc/sysconfig/lm_sensors
+ fi
+
# At first run search for sensors with sensors-detect
if [ ! -e /etc/sysconfig/lm_sensors ]; then
boot_mesg "Searching for Sensors..."
fi
# Enable sensors plugin if sensors found
- if [ $( sensors 2>&1 | grep "No sensors found!" | wc -l ) == "1" ]; then
+ if [ "$( sensors 2>&1 | grep 'No sensors found!' | wc -l )" == "1" ]; then
sed -i -e "s|^LoadPlugin sensors|#LoadPlugin sensors|g" /etc/collectd.conf
else
sed -i -e "s|^#LoadPlugin sensors|LoadPlugin sensors|g" /etc/collectd.conf
sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
fi
- boot_mesg "Starting Collection daemon..."
- /usr/sbin/collectd -C /etc/collectd.conf
- evaluate_retval
+ if [ $(date +%Y) -gt 2011 ]; then
+ boot_mesg "Starting Collection daemon..."
+ /usr/sbin/collectd -C /etc/collectd.conf
+ evaluate_retval
+ else
+ boot_mesg "collectd: cannot start with incorrect time ($(date))."
+ echo_warning;
+ fi
;;
stop)
+ boot_mesg "Stopping Collection daemon..."
+ killproc /usr/sbin/collectd
+ evaluate_retval
# Save the ramdisk at manual stop but not at shutdown
if [ "$(basename $0)" == "collectd" ]; then
/etc/init.d/tmpfs backup
fi
- boot_mesg "Stopping Collection daemon..."
- killproc /usr/sbin/collectd
- evaluate_retval
;;
restart)
${0} stop