From dde61dff5d7425b19bed4d8046f6c8bb3c7b847c Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Sat, 26 Dec 2009 13:38:40 +0100 Subject: [PATCH] init script: Check for config file only when starting the daemon. --- debian/collectd-core.collectd.init.d | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.30.2