Code

collectd.init.d: Do not restart collectd if the configuration test fails.
authorSebastian Harl <sh@tokkee.org>
Sun, 7 Dec 2008 17:51:57 +0000 (18:51 +0100)
committerSebastian Harl <sh@tokkee.org>
Sun, 7 Dec 2008 17:51:57 +0000 (18:51 +0100)
debian/changelog
debian/collectd.init.d

index 3699f1ec67f9fc3145b12e8d516a67febb6b2d15..a6e5dff90b0a3792787aec80af878be171add0fb 100644 (file)
@@ -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 <sh@tokkee.org>  Sun, 07 Dec 2008 18:20:41 +0100
+ -- Sebastian Harl <sh@tokkee.org>  Sun, 07 Dec 2008 18:50:32 +0100
 
 collectd (4.4.2-3) unstable; urgency=low
 
index e61bbe7504d3e6ad452e857d8afadb788f18dec4..737529969dac02a47ecd56db4510641f423f731c 100755 (executable)
@@ -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