]> git.pld-linux.org Git - packages/collectd.git/blobdiff - collectd.init
- release 2 - check configuration while restarting
[packages/collectd.git] / collectd.init
index bce6a5f79bf830b349b9188bb19abe9adc316659..7043090ee24692b00e2cff5c596f9c590662e2e1 100644 (file)
@@ -27,6 +27,10 @@ else
        exit 0
 fi
 
+checkconfig() {
+       /usr/sbin/collectd -t || exit 1
+}
+
 start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/collectd ]; then
@@ -51,6 +55,7 @@ stop() {
 
 condrestart() {
        if [ -f /var/lock/subsys/collectd ]; then
+               checkconfig
                stop
                start
        else
@@ -68,6 +73,7 @@ case "$1" in
        stop
        ;;
   restart)
+       checkconfig
        stop
        start
        ;;
@@ -78,6 +84,7 @@ case "$1" in
        condrestart 7
        ;;
   status)
+       checkconfig
        status collectd
        exit $?
        ;;
This page took 0.023954 seconds and 4 git commands to generate.