From: Sebastian Harl Date: Sat, 26 Dec 2009 12:38:40 +0000 (+0100) Subject: init script: Check for config file only when starting the daemon. X-Git-Tag: collectd-4.8.2-1~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=dde61dff5d7425b19bed4d8046f6c8bb3c7b847c;p=pkg-collectd.git init script: Check for config file only when starting the daemon. --- diff --git a/debian/collectd-core.collectd.init.d b/debian/collectd-core.collectd.init.d index d66df6d..d9fc0ef 100755 --- a/debian/collectd-core.collectd.init.d +++ b/debian/collectd-core.collectd.init.d @@ -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