From: Marc Fournier Date: Fri, 29 Aug 2014 15:26:41 +0000 (+0200) Subject: Merge branch 'collectd-5.3' into collectd-5.4 X-Git-Tag: collectd-5.4.2~19 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=1894607dc4c03ce20db7c5256c97890aa70bcaa5;hp=7de87be6f679d23cc311250559813e3b2db64795;p=collectd.git Merge branch 'collectd-5.3' into collectd-5.4 Conflicts: contrib/redhat/collectd.spec --- diff --git a/bindings/java/org/collectd/java/GenericJMXConfConnection.java b/bindings/java/org/collectd/java/GenericJMXConfConnection.java index 7fad08f9..81aee033 100644 --- a/bindings/java/org/collectd/java/GenericJMXConfConnection.java +++ b/bindings/java/org/collectd/java/GenericJMXConfConnection.java @@ -30,8 +30,6 @@ import java.net.InetAddress; import java.net.UnknownHostException; import javax.management.MBeanServerConnection; -import javax.management.ObjectName; -import javax.management.MalformedObjectNameException; import javax.management.remote.JMXServiceURL; import javax.management.remote.JMXConnector; diff --git a/contrib/redhat/collectd.spec b/contrib/redhat/collectd.spec index 43704c4f..7d60f7de 100644 --- a/contrib/redhat/collectd.spec +++ b/contrib/redhat/collectd.spec @@ -106,7 +106,7 @@ %define with_nut 0%{!?_without_nut:1} %define with_olsrd 0%{!?_without_olsrd:1} %define with_openvpn 0%{!?_without_openvpn:1} -%define with_perl 0%{!?_without_perl:0%{?_has_perl_extutils_embed}} +%define with_perl 0%{!?_without_perl:1} %define with_pinba 0%{!?_without_pinba:1} %define with_ping 0%{!?_without_ping:1} %define with_postgresql 0%{!?_without_postgresql:1} @@ -504,7 +504,11 @@ Summary: Perl plugin for collectd Group: System Environment/Daemons Requires: %{name}%{?_isa} = %{version}-%{release} Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +%if 0%{?rhel} >= 6 BuildRequires: perl-ExtUtils-Embed +%else +BuildRequires: perl +%endif %description perl The Perl plugin embeds a Perl interpreter into collectd and exposes the application programming interface (API) to Perl-scripts. @@ -2031,9 +2035,6 @@ fi - Enable cgroups, lvm and statsd plugins - Enable (but don't build by default) mic, aquaero and sigrok plugins -* Wed Aug 06 2014 Marc Fournier 5.3.1-2 -- Enabled modbus plugin - * Tue Aug 06 2013 Marc Fournier 5.3.1-1 - New upstream version - Added RHEL5 support: @@ -2043,6 +2044,8 @@ fi - Removed duplicate --enable-aggregation - Added some comments & usage examples - Replaced a couple of "Buildrequires" by "BuildRequires" +- Enabled modbus plugin +- Allow perl plugin to build on RHEL5 * Wed Apr 10 2013 Marc Fournier 5.3.0-1 - New upstream version diff --git a/src/collectd.conf.in b/src/collectd.conf.in index 678cfb35..e483d445 100644 --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -651,7 +651,7 @@ # AuthFile "/etc/collectd/passwd" # Interface "eth0" # -# MaxPacketSize 1024 +# MaxPacketSize 1452 # # # proxy setup (client and server as above): # Forward true diff --git a/src/java.c b/src/java.c index ee503550..83cd353f 100644 --- a/src/java.c +++ b/src/java.c @@ -2115,7 +2115,7 @@ static int cjni_thread_detach (void) /* {{{ */ cjni_env->jvm_env = NULL; return (0); -} /* }}} JNIEnv *cjni_thread_attach */ +} /* }}} int cjni_thread_detach */ static int cjni_config_add_jvm_arg (oconfig_item_t *ci) /* {{{ */ { @@ -2468,7 +2468,6 @@ static int cjni_read (user_data_t *ud) /* {{{ */ { JNIEnv *jvm_env; cjni_callback_info_t *cbi; - int status; int ret_status; if (jvm == NULL) @@ -2492,13 +2491,7 @@ static int cjni_read (user_data_t *ud) /* {{{ */ ret_status = (*jvm_env)->CallIntMethod (jvm_env, cbi->object, cbi->method); - status = cjni_thread_detach (); - if (status != 0) - { - ERROR ("java plugin: cjni_read: cjni_thread_detach failed."); - return (-1); - } - + cjni_thread_detach (); return (ret_status); } /* }}} int cjni_read */ @@ -2509,7 +2502,6 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */ JNIEnv *jvm_env; cjni_callback_info_t *cbi; jobject vl_java; - int status; int ret_status; if (jvm == NULL) @@ -2534,6 +2526,7 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */ if (vl_java == NULL) { ERROR ("java plugin: cjni_write: ctoj_value_list failed."); + cjni_thread_detach (); return (-1); } @@ -2542,13 +2535,7 @@ static int cjni_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */ (*jvm_env)->DeleteLocalRef (jvm_env, vl_java); - status = cjni_thread_detach (); - if (status != 0) - { - ERROR ("java plugin: cjni_write: cjni_thread_detach failed."); - return (-1); - } - + cjni_thread_detach (); return (ret_status); } /* }}} int cjni_write */ @@ -2560,7 +2547,6 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */ cjni_callback_info_t *cbi; jobject o_timeout; jobject o_identifier; - int status; int ret_status; if (jvm == NULL) @@ -2587,6 +2573,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */ { ERROR ("java plugin: cjni_flush: Converting double " "to Number object failed."); + cjni_thread_detach (); return (-1); } @@ -2598,6 +2585,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */ { (*jvm_env)->DeleteLocalRef (jvm_env, o_timeout); ERROR ("java plugin: cjni_flush: NewStringUTF failed."); + cjni_thread_detach (); return (-1); } } @@ -2608,13 +2596,7 @@ static int cjni_flush (cdtime_t timeout, const char *identifier, /* {{{ */ (*jvm_env)->DeleteLocalRef (jvm_env, o_identifier); (*jvm_env)->DeleteLocalRef (jvm_env, o_timeout); - status = cjni_thread_detach (); - if (status != 0) - { - ERROR ("java plugin: cjni_flush: cjni_thread_detach failed."); - return (-1); - } - + cjni_thread_detach (); return (ret_status); } /* }}} int cjni_flush */ @@ -2640,7 +2622,10 @@ static void cjni_log (int severity, const char *message, /* {{{ */ o_message = (*jvm_env)->NewStringUTF (jvm_env, message); if (o_message == NULL) + { + cjni_thread_detach (); return; + } (*jvm_env)->CallVoidMethod (jvm_env, cbi->object, cbi->method, (jint) severity, o_message); @@ -2658,7 +2643,6 @@ static int cjni_notification (const notification_t *n, /* {{{ */ JNIEnv *jvm_env; cjni_callback_info_t *cbi; jobject o_notification; - int status; int ret_status; if (jvm == NULL) @@ -2683,6 +2667,7 @@ static int cjni_notification (const notification_t *n, /* {{{ */ if (o_notification == NULL) { ERROR ("java plugin: cjni_notification: ctoj_notification failed."); + cjni_thread_detach (); return (-1); } @@ -2691,13 +2676,7 @@ static int cjni_notification (const notification_t *n, /* {{{ */ (*jvm_env)->DeleteLocalRef (jvm_env, o_notification); - status = cjni_thread_detach (); - if (status != 0) - { - ERROR ("java plugin: cjni_read: cjni_thread_detach failed."); - return (-1); - } - + cjni_thread_detach (); return (ret_status); } /* }}} int cjni_notification */ @@ -2725,24 +2704,20 @@ static int cjni_match_target_create (const oconfig_item_t *ci, /* {{{ */ (*jvm_env)->DeleteLocalRef (jvm_env, cbi_ret->object); \ } \ free (cbi_ret); \ - if (jvm_env != NULL) { \ - if (o_ci != NULL) \ - (*jvm_env)->DeleteLocalRef (jvm_env, o_ci); \ - cjni_thread_detach (); \ - } \ + if (o_ci != NULL) \ + (*jvm_env)->DeleteLocalRef (jvm_env, o_ci); \ + cjni_thread_detach (); \ return (status) if (jvm == NULL) { ERROR ("java plugin: cjni_read: jvm == NULL"); - BAIL_OUT (-1); + return (-1); } jvm_env = cjni_thread_attach (); if (jvm_env == NULL) - { - BAIL_OUT (-1); - } + return (-1); /* Find out whether to create a match or a target. */ if (strcasecmp ("Match", ci->key) == 0) @@ -2936,10 +2911,7 @@ static int cjni_match_target_invoke (const data_set_t *ds, /* {{{ */ } } /* if (cbi->type == CB_TYPE_TARGET) */ - status = cjni_thread_detach (); - if (status != 0) - ERROR ("java plugin: cjni_read: cjni_thread_detach failed."); - + cjni_thread_detach (); return (ret_status); } /* }}} int cjni_match_target_invoke */