]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - src/initscripts/init.d/collectd
Merge remote-tracking branch 'mfischer/iputils' into next
[ipfire-2.x.git] / src / initscripts / init.d / collectd
index 7de005eb41dd56e37be8e9491ce9474b9f9a7fc7..96bd12676cec3e0aed41344556a4249bdd720e91 100644 (file)
@@ -84,11 +84,14 @@ case "$1" in
                fi
 
                # Enable swap plugin if swap found
-               if [ "$(swapon -s | wc -l)" == "1" ]; then
+               if [ "$(swapon -s | wc -l)" == "0" ]; then
                        sed -i -e "s|^LoadPlugin swap|#LoadPlugin swap|g" /etc/collectd.conf
                else
                        sed -i -e "s|^#LoadPlugin swap|LoadPlugin swap|g" /etc/collectd.conf
                fi
+               
+               # sync after config update...
+               sync
 
                if [ $(date +%Y) -gt 2011 ]; then
                        boot_mesg "Starting Collection daemon..."
@@ -107,6 +110,8 @@ case "$1" in
                if [ "$(basename $0)" == "collectd" ]; then
                    /etc/init.d/tmpfs backup
                fi
+               # sync after backup...
+               sync
                ;;
        restart)
                ${0} stop