[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#681668: unblock: collectd/5.1.0-3



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package collectd (a statistics collection and monitoring
daemon).

The upload fixes one important and on RC bug, both fixing upgrade
issues. Please see the attached debdiff for details.

From the changelog:

collectd (5.1.0-3) unstable; urgency=low

  * debian/patches/migrate-4-5-df.dpatch, debian/collectd-core.postinst:
    - Added patch to fix the migration of 'df' values in migrate-4-5.px;
      thanks to 'markuskaindl' for reporting this on IRC.
    - Pass --rrdfilter and --rrdtool parameters to migrate-4-5.px in order to
      let the script find those binaries/scripts.
    (Closes: #681363)
  * debian/collectd-core.collectd.init.d:
    - Catch disabled state in start and restart and don't exit with an error
      status. Amongst others, this fixes an upgrade of collectd when the
      daemon is disabled. Thanks to Florian Ernst for reporting this and
      Evgeni Golov for providing (an early) patch (Closes: #681216).
    - Don't use 'set -e' and 'exit 0' (at the end) in order to let return
      statuses propagate correctly. (cf. #681216)

unblock collectd/5.1.0-3

TIA,
Sebastian

-- 
Sebastian "tokkee" Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety.         -- Benjamin Franklin

debdiff collectd_5.1.0-2_amd64.deb collectd_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-138-] {+139+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff collectd-core_5.1.0-2_amd64.deb collectd-core_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-2727-] {+2728+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff collectd-dbg_5.1.0-2_amd64.deb collectd-dbg_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: collectd-core (= [-5.1.0-2)-] {+5.1.0-3)+}
Recommends: collectd-utils (= [-5.1.0-2),-] {+5.1.0-3),+} libcollectdclient0 (= [-5.1.0-2)-] {+5.1.0-3)+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff collectd-dev_5.1.0-2_all.deb collectd-dev_5.1.0-3_all.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: collectd-core (>= [-5.1.0-2),-] {+5.1.0-3),+} collectd-core (<< 5.2~)
Installed-Size: [-299-] {+300+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff collectd-utils_5.1.0-2_amd64.deb collectd-utils_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-162-] {+163+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff libcollectdclient0_5.1.0-2_amd64.deb libcollectdclient0_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Installed-Size: [-133-] {+134+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff libcollectdclient-dev_5.1.0-2_amd64.deb libcollectdclient-dev_5.1.0-3_amd64.deb
File lists identical (after any substitutions)

Control files: lines which differ (wdiff format)
------------------------------------------------
Depends: libcollectdclient0 (= [-5.1.0-2)-] {+5.1.0-3)+}
Version: [-5.1.0-2-] {+5.1.0-3+}


debdiff collectd_5.1.0-2.dsc collectd_5.1.0-3.dsc
diff -u collectd-5.1.0/debian/collectd-core.collectd.init.d collectd-5.1.0/debian/collectd-core.collectd.init.d
--- collectd-5.1.0/debian/collectd-core.collectd.init.d
+++ collectd-5.1.0/debian/collectd-core.collectd.init.d
@@ -22,8 +22,6 @@
 #                    the values in a variety of ways.
 ### END INIT INFO
 
-set -e
-
 . /lib/lsb/init-functions
 
 export PATH=/sbin:/bin:/usr/sbin:/usr/bin
@@ -50,16 +48,6 @@
 	. /etc/default/$NAME
 fi
 
-if test "$DISABLE" != 0 -a "$1" == "start"; then
-	log_warning_msg "Not starting $DESC, disabled by /etc/default/$NAME."
-	exit 0
-fi
-
-if test ! -e "$CONFIGFILE" -a "$1" == "start"; then
-	log_warning_msg "Not starting $DESC, no configuration ($CONFIGFILE) found."
-	exit 0
-fi
-
 if test "$ENABLE_COREFILES" == 1; then
 	ulimit -c unlimited
 fi
@@ -70,28 +58,41 @@
 	_PIDFILE="$PIDFILE"
 fi
 
+# return:
+#   0 if config is fine
+#   1 if there is a syntax error
+#   2 if there is no configuration
 check_config() {
+	if test ! -e "$CONFIGFILE"; then
+		return 2
+	fi
 	if ! $DAEMON -t -C "$CONFIGFILE"; then
 		return 1
 	fi
+	return 0
 }
 
+# return:
+#   0 if the daemon has been started
+#   1 if the daemon was already running
+#   2 if the daemon could not be started
+#   3 if the daemon was not supposed to be started
 d_start() {
 	if test "$DISABLE" != 0; then
 		# we get here during restart
 		log_progress_msg "disabled by /etc/default/$NAME"
-		return 2
+		return 3
 	fi
 
 	if test ! -e "$CONFIGFILE"; then
 		# we get here during restart
 		log_progress_msg "disabled, no configuration ($CONFIGFILE) found"
-		return 2
+		return 3
 	fi
 
 	check_config
 	rc="$?"
-	if test "$rc" -eq 1; then
+	if test "$rc" -ne 0; then
 		log_progress_msg "not starting, configuration error"
 		return 2
 	fi
@@ -105,6 +106,7 @@
 			--exec $DAEMON -- -C "$CONFIGFILE" -P "$_PIDFILE" \
 			|| return 2
 	fi
+	return 0
 }
 
 still_running_warning="
@@ -112,6 +114,10 @@
 In large setups it might take some time to write all pending data to
 the disk. You can adjust the waiting time in /etc/default/collectd."
 
+# return:
+#   0 if the daemon has been stopped
+#   1 if the daemon was already stopped
+#   2 if daemon could not be stopped
 d_stop() {
 	PID=$( cat "$_PIDFILE" 2> /dev/null ) || true
 
@@ -148,6 +154,8 @@
 		case "$?" in
 			0|1) log_end_msg 0 ;;
 			2) log_end_msg 1 ;;
+			3) log_end_msg 255; true ;;
+			*) log_end_msg 1 ;;
 		esac
 		;;
 	stop)
@@ -178,7 +186,9 @@
 				d_start
 				rc2="$?"
 				case "$rc2" in
-					0) log_end_msg 0 ;;
+					0|1) log_end_msg 0 ;;
+					2) log_end_msg 1 ;;
+					3) log_end_msg 255; true ;;
 					*) log_end_msg 1 ;;
 				esac
 				;;
@@ -194,6 +204,4 @@
 esac
 
-exit 0
-
 # vim: syntax=sh noexpandtab sw=4 ts=4 :
 
diff -u collectd-5.1.0/debian/changelog collectd-5.1.0/debian/changelog
--- collectd-5.1.0/debian/changelog
+++ collectd-5.1.0/debian/changelog
@@ -1,3 +1,21 @@
+collectd (5.1.0-3) unstable; urgency=low
+
+  * debian/patches/migrate-4-5-df.dpatch, debian/collectd-core.postinst:
+    - Added patch to fix the migration of 'df' values in migrate-4-5.px;
+      thanks to 'markuskaindl' for reporting this on IRC.
+    - Pass --rrdfilter and --rrdtool parameters to migrate-4-5.px in order to
+      let the script find those binaries/scripts.
+    (Closes: #681363)
+  * debian/collectd-core.collectd.init.d:
+    - Catch disabled state in start and restart and don't exit with an error
+      status. Amongst others, this fixes an upgrade of collectd when the
+      daemon is disabled. Thanks to Florian Ernst for reporting this and
+      Evgeni Golov for providing (an early) patch (Closes: #681216).
+    - Don't use 'set -e' and 'exit 0' (at the end) in order to let return
+      statuses propagate correctly. (cf. #681216)
+
+ -- Sebastian Harl <tokkee@debian.org>  Sun, 15 Jul 2012 11:17:10 +0200
+
 collectd (5.1.0-2) unstable; urgency=low
 
   * debian/collectd-core.postinst:
diff -u collectd-5.1.0/debian/collectd-core.postinst collectd-5.1.0/debian/collectd-core.postinst
--- collectd-5.1.0/debian/collectd-core.postinst
+++ collectd-5.1.0/debian/collectd-core.postinst
@@ -45,7 +45,9 @@
         if [ "$RET" = "true" ]; then
             cp -a /var/lib/collectd/ /var/backups/collectd-"$2"
             /usr/lib/collectd/utils/migrate-4-5.px \
-                -indir /var/lib/collectd/rrd/ | bash
+                --rrdfilter /usr/lib/collectd/utils/rrd_filter.px \
+                --rrdtool /usr/bin/rrdtool \
+                --indir /var/lib/collectd/rrd/ | bash
         fi
     ;;
 
diff -u collectd-5.1.0/debian/patches/00list collectd-5.1.0/debian/patches/00list
--- collectd-5.1.0/debian/patches/00list
+++ collectd-5.1.0/debian/patches/00list
@@ -4,0 +5 @@
+migrate-4-5-df.dpatch
only in patch2:
unchanged:
--- collectd-5.1.0.orig/debian/patches/migrate-4-5-df.dpatch
+++ collectd-5.1.0/debian/patches/migrate-4-5-df.dpatch
@@ -0,0 +1,66 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## migrate-4-5-df.dpatch by Florian Forster <octo@collectd.org>
+##
+## DP: contrib/migrate-4-5.px: Break up "df" RRD files into multiple files.
+## DP: cf. upstream commit 605dab534eb2f0ee26446c157c9fdd2ad6e9427a
+
+@DPATCH@
+
+diff --git a/contrib/migrate-4-5.px b/contrib/migrate-4-5.px
+index d3ff796..c39b51b 100755
+--- a/contrib/migrate-4-5.px
++++ b/contrib/migrate-4-5.px
+@@ -33,6 +33,7 @@ use File::Basename ('dirname');
+ 
+ our $InDir = '/var/lib/collectd';
+ our $RRDtool = 'rrdtool';
++our $RRDFilter = 'rrd_filter.px';
+ 
+ our %TypesCounterToDerive = # {{{
+ (
+@@ -184,7 +185,15 @@ sub handle_file # {{{
+   {
+     my $dir = join ('/', @path);
+     print "mkdir -p \"$dir/$plugin-$type_inst\"\n";
+-    print "mv \"$path\" \"$dir/$plugin-$type_inst/$type.rrd\"\n";
++    if (($plugin eq 'df') and ($type eq 'df'))
++    {
++      print "$RRDFilter --infile=\"$path\" --outfile=\"$dir/$plugin-$type_inst/df_complex-free.rrd\" --map free:value\n";
++      print "$RRDFilter --infile=\"$path\" --outfile=\"$dir/$plugin-$type_inst/df_complex-used.rrd\" --map used:value\n";
++    }
++    else
++    {
++      print "mv \"$path\" \"$dir/$plugin-$type_inst/$type.rrd\"\n";
++    }
+   }
+ } # }}} sub handle_file
+ 
+@@ -223,10 +232,12 @@ migrate-4-5.px [OPTIONS]
+ 
+ Valid options are:
+ 
+-  --indir <dir>      Source directory
+-                     Default: $InDir
+-  --rrdtool <path>   Path to the RRDtool binary
+-                     Default: $RRDtool
++  --indir <dir>         Source directory
++                        Default: $InDir
++  --rrdtool <path>      Path to the RRDtool binary
++                        Default: $RRDtool
++  --rrdfilter <path>    Path to the rrd_filter.px script
++                        Default: $RRDFilter
+ 
+ EOF
+   exit (1);
+@@ -234,8 +245,11 @@ EOF
+ 
+ GetOptions ("indir|i=s" => \$InDir,
+         "rrdtool=s" => \$RRDtool,
++        "rrdfilter=s" => \$RRDFilter,
+         "help|h" => \&exit_usage) or exit_usage ();
+ 
++print "#!/bin/bash\n\n";
++
+ scan_dir ($InDir);
+ 
+ # vim: set sw=2 sts=2 et fdm=marker :

Attachment: signature.asc
Description: Digital signature


Reply to: