From: Sebastian Harl Date: Sun, 7 Dec 2008 17:51:57 +0000 (+0100) Subject: collectd.init.d: Do not restart collectd if the configuration test fails. X-Git-Tag: collectd-4.5.1-1~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4ba2af428bfe18ff55a1512b59d211d8403252fe;p=pkg-collectd.git collectd.init.d: Do not restart collectd if the configuration test fails. --- diff --git a/debian/changelog b/debian/changelog index 3699f1e..a6e5dff 100644 --- a/debian/changelog +++ b/debian/changelog @@ -34,8 +34,10 @@ collectd (4.5.1-1) experimental; urgency=low * debian/collectd.overrides: - Override "spelling-error-in-description" for the postgresql plugin name - all plugins are spelled lowercase. + * debian/collectd.init.d: + - Do not restart collectd if the configuration test fails. - -- Sebastian Harl Sun, 07 Dec 2008 18:20:41 +0100 + -- Sebastian Harl Sun, 07 Dec 2008 18:50:32 +0100 collectd (4.4.2-3) unstable; urgency=low diff --git a/debian/collectd.init.d b/debian/collectd.init.d index e61bbe7..7375299 100755 --- a/debian/collectd.init.d +++ b/debian/collectd.init.d @@ -59,6 +59,15 @@ else _PIDFILE="$PIDFILE" fi +check_config() { + if ! $DAEMON -t -C "$CONFIGFILE"; then + if test -n "$1"; then + echo "$1" >&2 + fi + exit 1 + fi +} + d_start() { if test "$DISABLE" != 0; then # we get here during restart @@ -66,9 +75,7 @@ d_start() { return 0 fi - if ! $DAEMON -t -C "$CONFIGFILE"; then - exit 1 - fi + check_config if test "$USE_COLLECTDMON" == 1; then start-stop-daemon --start --quiet --pidfile "$_PIDFILE" \ @@ -142,6 +149,7 @@ case "$1" in ;; restart|force-reload) echo -n "Restarting $DESC: $NAME" + check_config "Not restarting collectd." d_stop sleep 1 d_start