From 2e4a58dec70342c3ad27aa2c5cb85a72dbe8d4db Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 7 Feb 2008 22:43:09 +0100 Subject: [PATCH] collectd.init.d: Test config file before starting collectd. --- debian/collectd.init.d | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.30.2