Code

collectd.init.d: Test config file before starting collectd.
authorSebastian Harl <sh@tokkee.org>
Thu, 7 Feb 2008 21:43:09 +0000 (22:43 +0100)
committerSebastian Harl <sh@tokkee.org>
Thu, 7 Feb 2008 21:43:09 +0000 (22:43 +0100)
debian/collectd.init.d

index 207588726abc61bc1999a1dac6b4d0ab714f23e9..1d2991f6487c3c832740924ed270ee36d8733ecd 100755 (executable)
@@ -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