Code

init script: Check for config file only when starting the daemon.
authorSebastian Harl <sh@tokkee.org>
Sat, 26 Dec 2009 12:38:40 +0000 (13:38 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 26 Dec 2009 12:38:40 +0000 (13:38 +0100)
debian/collectd-core.collectd.init.d

index d66df6d273b9f04ba3c6fece5ceefd4f8a331846..d9fc0efaf1f6a8bb0e60ad53fc1000990d9daaa9 100755 (executable)
@@ -49,7 +49,7 @@ if test "$DISABLE" != 0 -a "$1" == "start"; then
        exit 0
 fi
 
-if ! test -e "$CONFIGFILE"; then
+if test ! -e "$CONFIGFILE" -a "$1" == "start"; then
        echo "Not starting $NAME - no configuration ($CONFIGFILE) found."
        exit 0
 fi
@@ -80,6 +80,12 @@ d_start() {
                return 0
        fi
 
+       if test ! -e "$CONFIGFILE"; then
+               # we get here during restart
+               echo -n " - no configuration ($CONFIGFILE) found."
+               return 0
+       fi
+
        check_config
 
        if test "$USE_COLLECTDMON" == 1; then