rpms/collectd/F-11 collectd-4.5.4-fix-condrestart.patch, NONE, 1.1 collectd-4.5.4-libvirt-reconnect.patch, NONE, 1.1 collectd.spec, 1.19, 1.20

Alan Pevec apevec at fedoraproject.org
Tue Aug 11 22:34:15 UTC 2009


Author: apevec

Update of /cvs/pkgs/rpms/collectd/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32714

Modified Files:
	collectd.spec 
Added Files:
	collectd-4.5.4-fix-condrestart.patch 
	collectd-4.5.4-libvirt-reconnect.patch 
Log Message:
* Wed Aug 12 2009 Alan Pevec <apevec at redhat.com> 4.5.4-2
- fix condrestart: on upgrade collectd is not restarted, bz# 516273
- collectd does not re-connect to libvirtd, bz# 480997



collectd-4.5.4-fix-condrestart.patch:
 init.d-collectd |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- NEW FILE collectd-4.5.4-fix-condrestart.patch ---
--- contrib/fedora/init.d-collectd.orig	2009-08-11 01:50:15.000000000 +0200
+++ contrib/fedora/init.d-collectd	2009-08-11 01:51:10.000000000 +0200
@@ -54,7 +54,7 @@
 	start
 	;;
   condrestart)
-	[ -f /var/lock/subsys/$prog ] && restart || :
+	[ -f /var/lock/subsys/$prog ] && stop && start || :
 	;;
   *)
 	echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"

collectd-4.5.4-libvirt-reconnect.patch:
 libvirt.c |   27 +++++++++++++++++----------
 1 file changed, 17 insertions(+), 10 deletions(-)

--- NEW FILE collectd-4.5.4-libvirt-reconnect.patch ---
--- a/src/libvirt.c	2009-08-11 23:27:35.000000000 +0200
+++ b/src/libvirt.c	2009-08-12 00:14:58.000000000 +0200
@@ -49,6 +49,8 @@
 
 /* Connection. */
 static virConnectPtr conn = 0;
+static char *conn_string = NULL;
+static int conn_count = 0;
 
 /* Seconds between list refreshes, 0 disables completely. */
 static int interval = 60;
@@ -153,14 +155,14 @@
         il_interface_devices = ignorelist_create (1);
 
     if (strcasecmp (key, "Connection") == 0) {
-        if (conn != 0) {
+        if (conn_count++ != 0) {
             ERROR ("Connection may only be given once in config file");
             return 1;
         }
-        conn = virConnectOpenReadOnly (value);
-        if (!conn) {
-            VIRT_ERROR (NULL, "connection failed");
-            return 1;
+        conn_string = strdup(value);
+        if (conn_string == NULL) {
+            ERROR ("libvirt plugin: Connection strdup failed.");
+            return -1;
         }
         return 0;
     }
@@ -253,10 +255,11 @@
     int i;
 
     if (conn == NULL) {
-        ERROR ("libvirt plugin: Not connected. Use Connection in "
-                "config file to supply connection URI.  For more information "
-                "see <http://libvirt.org/uri.html>");
-        return -1;
+        conn = virConnectOpenReadOnly (conn_string);
+	if (conn == NULL) {
+	    ERROR ("libvirt plugin: Not connected.");
+	    return -1;
+	}
     }
 
     time (&t);
@@ -264,8 +267,12 @@
     /* Need to refresh domain or device lists? */
     if ((last_refresh == (time_t) 0) ||
             ((interval > 0) && ((last_refresh + interval) <= t))) {
-        if (refresh_lists () != 0)
+        if (refresh_lists () != 0) {
+            if (conn != NULL)
+                virConnectClose (conn);
+            conn = NULL;
             return -1;
+        }
         last_refresh = t;
     }
 


Index: collectd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/collectd/F-11/collectd.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -p -r1.19 -r1.20
--- collectd.spec	10 Aug 2009 23:41:40 -0000	1.19
+++ collectd.spec	11 Aug 2009 22:34:15 -0000	1.20
@@ -1,7 +1,7 @@
 Summary: Statistics collection daemon for filling RRD files
 Name: collectd
 Version: 4.5.4
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: GPLv2
 Group: System Environment/Daemons
 URL: http://collectd.org/
@@ -10,6 +10,10 @@ Source: http://collectd.org/files/%{name
 Patch0: %{name}-4.5.1-include-collectd.d.patch
 # bug 468067 "pkg-config --libs OpenIPMIpthread" fails
 Patch1: %{name}-4.5.1-configure-OpenIPMI.patch
+# bug 516273 on upgrade collectd is not restarted
+Patch2: %{name}-%{version}-fix-condrestart.patch
+# bug 480997 collectd does not re-connect to libvirtd
+Patch3: %{name}-%{version}-libvirt-reconnect.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 
@@ -151,6 +155,8 @@ This plugin collects information from vi
 %setup -q
 %patch0 -p1
 %patch1 -p0
+%patch2 -p0
+%patch3 -p1
 
 sed -i.orig -e 's|-Werror||g' Makefile.in */Makefile.in
 
@@ -407,6 +413,10 @@ fi
 
 
 %changelog
+* Wed Aug 12 2009 Alan Pevec <apevec at redhat.com> 4.5.4-2
+- fix condrestart: on upgrade collectd is not restarted, bz# 516273
+- collectd does not re-connect to libvirtd, bz# 480997
+
 * Tue Aug 11 2009 Alan Pevec <apevec at redhat.com> 4.5.4-1
 - New upstream version 4.5.4
   http://collectd.org/news.shtml#news66




More information about the scm-commits mailing list