From: Sebastian Harl Date: Thu, 7 Feb 2008 21:43:09 +0000 (+0100) Subject: collectd.init.d: Test config file before starting collectd. X-Git-Tag: collectd-4.3.0-1~14 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2e4a58dec70342c3ad27aa2c5cb85a72dbe8d4db;p=pkg-collectd.git collectd.init.d: Test config file before starting collectd. --- diff --git a/debian/collectd.init.d b/debian/collectd.init.d index 2075887..1d2991f 100755 --- a/debian/collectd.init.d +++ b/debian/collectd.init.d @@ -60,6 +60,11 @@ else fi d_start() { + if ! $DAEMON -t -C "$CONFIGFILE" > /dev/null 2>&1; then + $DAEMON -t -C "$CONFIGFILE" + exit 1 + fi + if test "$USE_COLLECTDMON" == 1; then start-stop-daemon --start --quiet --pidfile "$_PIDFILE" \ --exec $COLLECTDMON_DAEMON -- -P "$_PIDFILE" -- -C "$CONFIGFILE" @@ -87,7 +92,7 @@ d_stop() { echo -n " ." if test $i -gt $MAXWAIT; then - echo "$still_running_warning" + echo "$still_running_warning" >&2 return 1 fi