rpms/collectd/devel collectd-4.5.4-fix-condrestart.patch, NONE, 1.1 collectd-4.5.4-libvirt-reconnect.patch, NONE, 1.1

Alan Pevec apevec at fedoraproject.org
Wed Sep 2 13:52:55 UTC 2009


Author: apevec

Update of /cvs/pkgs/rpms/collectd/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31642

Added Files:
	collectd-4.5.4-fix-condrestart.patch 
	collectd-4.5.4-libvirt-reconnect.patch 
Log Message:
* Wed Sep 02 2009 Alan Pevec <apevec at redhat.com> 4.6.4-1
- fix condrestart: on upgrade collectd is not restarted, bz# 516273
- collectd does not re-connect to libvirtd, bz# 480997
- fix unpackaged files https://bugzilla.redhat.com/show_bug.cgi?id=516276#c4
- New upstream version 4.6.4
  http://collectd.org/news.shtml#news69


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;
     }
 




More information about the fedora-extras-commits mailing list