diff --git a/utils/collectd/Makefile b/utils/collectd/Makefile index f92e17a4a7..7b4ee08eec 100644 --- a/utils/collectd/Makefile +++ b/utils/collectd/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2006-2015 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,12 +8,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=collectd -PKG_VERSION:=5.5.0 -PKG_RELEASE:=5 +PKG_VERSION:=5.5.1 +PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=http://collectd.org/files/ -PKG_MD5SUM:=c39305ef5514b44238b0d31f77e29e6a +PKG_MD5SUM:=fd24b947cef9351ce3e2d6d2a0762e18 PKG_FIXUP:=autoreconf PKG_REMOVE_FILES:=aclocal.m4 libltdl/aclocal.m4 diff --git a/utils/collectd/files/collectd.init b/utils/collectd/files/collectd.init index 8204c38acb..727e020aac 100644 --- a/utils/collectd/files/collectd.init +++ b/utils/collectd/files/collectd.init @@ -1,15 +1,13 @@ #!/bin/sh /etc/rc.common -# Copyright (C) 2006-2011 OpenWrt.org +# Copyright (C) 2006-2016 OpenWrt.org START=80 -SERVICE_USE_PID=1 +USE_PROCD=1 -start() { - mkdir -m 0755 -p /var/lib/collectd - service_start /usr/sbin/collectd +start_service() { + procd_open_instance + procd_set_param command /usr/sbin/collectd -f + procd_close_instance } -stop() { - service_stop /usr/sbin/collectd -} diff --git a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch index e9059d5324..704962f75b 100644 --- a/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch +++ b/utils/collectd/patches/100-rrdtool-add-rrasingle-option.patch @@ -17,7 +17,7 @@ /* consolidation_functions = */ NULL, /* consolidation_functions_num = */ 0, -@@ -1093,6 +1096,14 @@ static int rrd_config (const char *key, +@@ -1110,6 +1113,14 @@ static int rrd_config (const char *key, free (value_copy); } @@ -34,7 +34,7 @@ double tmp = atof (value); --- a/src/utils_rrdcreate.c +++ b/src/utils_rrdcreate.c -@@ -217,6 +217,9 @@ static int rra_get (char ***ret, const v +@@ -213,6 +213,9 @@ static int rra_get (char ***ret, const v rts_num = rra_timespans_num; } @@ -42,8 +42,8 @@ + rra_types_num = 1; + rra_max = rts_num * rra_types_num; + assert (rra_max > 0); - if ((rra_def = (char **) malloc ((rra_max + 1) * sizeof (char *))) == NULL) --- a/src/utils_rrdcreate.h +++ b/src/utils_rrdcreate.h @@ -41,6 +41,8 @@ struct rrdcreate_config_s diff --git a/utils/collectd/patches/140-fix-fqdnlookup.patch b/utils/collectd/patches/140-fix-fqdnlookup.patch index 660b87d2c4..22990bd5be 100644 --- a/utils/collectd/patches/140-fix-fqdnlookup.patch +++ b/utils/collectd/patches/140-fix-fqdnlookup.patch @@ -1,6 +1,6 @@ --- a/src/daemon/configfile.c +++ b/src/daemon/configfile.c -@@ -109,7 +109,7 @@ static cf_global_option_t cf_global_opti +@@ -111,7 +111,7 @@ static cf_global_option_t cf_global_opti {"BaseDir", NULL, PKGLOCALSTATEDIR}, {"PIDFile", NULL, PIDFILE}, {"Hostname", NULL, NULL}, diff --git a/utils/collectd/patches/200-fix-git-describe-error.patch b/utils/collectd/patches/200-fix-git-describe-error.patch index 5aa48dcda7..d9f1311a5d 100644 --- a/utils/collectd/patches/200-fix-git-describe-error.patch +++ b/utils/collectd/patches/200-fix-git-describe-error.patch @@ -2,7 +2,7 @@ +++ b/version-gen.sh @@ -2,7 +2,7 @@ - DEFAULT_VERSION="5.5.0.git" + DEFAULT_VERSION="5.5.1.git" -VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`" +#VERSION="`git describe 2> /dev/null | grep collectd | sed -e 's/^collectd-//'`" diff --git a/utils/collectd/patches/300-delay-first-read-cycle.patch b/utils/collectd/patches/300-delay-first-read-cycle.patch index 9a60cc4640..495c80f3ae 100644 --- a/utils/collectd/patches/300-delay-first-read-cycle.patch +++ b/utils/collectd/patches/300-delay-first-read-cycle.patch @@ -9,4 +9,3 @@ rf->rf_effective_interval = rf->rf_interval; pthread_mutex_lock (&read_lock); - diff --git a/utils/collectd/patches/500-upstream-parallel-build-fix.patch b/utils/collectd/patches/500-upstream-parallel-build-fix.patch deleted file mode 100644 index a10fbbb2c3..0000000000 --- a/utils/collectd/patches/500-upstream-parallel-build-fix.patch +++ /dev/null @@ -1,17 +0,0 @@ -Backport of 780e6a76021a240e95007a04b723d827120afa95 -Subject: [PATCH] build: add libavltree, libcommon & libheap dependencies - -Otherwise it can break on very parallel builds since collectd link time -arrives before one or more of these were built. - ---- a/src/daemon/Makefile.am -+++ b/src/daemon/Makefile.am -@@ -49,7 +49,7 @@ collectd_CPPFLAGS = $(AM_CPPFLAGS) $(LT - collectd_CFLAGS = $(AM_CFLAGS) - collectd_LDFLAGS = -export-dynamic - collectd_LDADD = libavltree.la libcommon.la libheap.la -lm --collectd_DEPENDENCIES = -+collectd_DEPENDENCIES = libavltree.la libcommon.la libheap.la - - # Link to these libraries.. - if BUILD_WITH_LIBRT diff --git a/utils/collectd/patches/600-fix-libmodbus-detection.patch b/utils/collectd/patches/600-fix-libmodbus-detection.patch new file mode 100644 index 0000000000..027ba5befc --- /dev/null +++ b/utils/collectd/patches/600-fix-libmodbus-detection.patch @@ -0,0 +1,40 @@ +Patch reverts upstream commit: +https://github.com/collectd/collectd/commit/6124da7a48f28f54fc09ebeb942d1037516fe6ab + +The commit changed the detection path due to FreeBSD issues, +but apparently affects also Openwrt buildroot negatively. + +Original explanation: + From 6124da7a48f28f54fc09ebeb942d1037516fe6ab Mon Sep 17 00:00:00 2001 + Subject: [PATCH] Fix libmodbus detection on FreeBSD + + We look for modbus/modbus.h in /usr/local/include/modbus + but we should look for modbus.h + + This is only an issue on FreeBSD since /usr/local/include is not + in the default search path. + +Reversed patch to be applied: + +--- a/configure.ac ++++ b/configure.ac +@@ -2585,7 +2585,7 @@ then + SAVE_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $with_libmodbus_cflags" + +- AC_CHECK_HEADERS(modbus.h, [], [with_libmodbus="no (modbus.h not found)"]) ++ AC_CHECK_HEADERS(modbus/modbus.h, [], [with_libmodbus="no (modbus/modbus.h not found)"]) + + CPPFLAGS="$SAVE_CPPFLAGS" + fi +--- a/src/modbus.c ++++ b/src/modbus.c +@@ -27,7 +27,7 @@ + + #include + +-#include ++#include + + #ifndef LIBMODBUS_VERSION_CHECK + /* Assume version 2.0.3 */ diff --git a/utils/collectd/patches/900-add-iwinfo-plugin.patch b/utils/collectd/patches/900-add-iwinfo-plugin.patch index 6b36b9a232..92c0877ed0 100644 --- a/utils/collectd/patches/900-add-iwinfo-plugin.patch +++ b/utils/collectd/patches/900-add-iwinfo-plugin.patch @@ -1,6 +1,6 @@ --- a/configure.ac +++ b/configure.ac -@@ -589,6 +589,9 @@ AC_CHECK_HEADERS(net/pfvar.h, +@@ -663,6 +663,9 @@ AC_CHECK_HEADERS(net/pfvar.h, have_termios_h="no" AC_CHECK_HEADERS(termios.h, [have_termios_h="yes"]) @@ -10,7 +10,7 @@ # For the turbostat plugin have_asm_msrindex_h="no" AC_CHECK_HEADERS(asm/msr-index.h, [have_asm_msrindex_h="yes"]) -@@ -5171,6 +5174,7 @@ plugin_interface="no" +@@ -5241,6 +5244,7 @@ plugin_interface="no" plugin_ipmi="no" plugin_ipvs="no" plugin_irq="no" @@ -18,7 +18,7 @@ plugin_load="no" plugin_log_logstash="no" plugin_memory="no" -@@ -5562,6 +5566,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi], +@@ -5638,6 +5642,7 @@ AC_PLUGIN([ipmi], [$plugin_ipmi], AC_PLUGIN([iptables], [$with_libiptc], [IPTables rule counters]) AC_PLUGIN([ipvs], [$plugin_ipvs], [IPVS connection statistics]) AC_PLUGIN([irq], [$plugin_irq], [IRQ statistics]) @@ -26,7 +26,7 @@ AC_PLUGIN([java], [$with_java], [Embed the Java Virtual Machine]) AC_PLUGIN([load], [$plugin_load], [System load]) AC_PLUGIN([logfile], [yes], [File logging plugin]) -@@ -5891,6 +5896,7 @@ Configuration: +@@ -5967,6 +5972,7 @@ Configuration: oracle . . . . . . . $with_oracle protobuf-c . . . . . $have_protoc_c python . . . . . . . $with_python @@ -34,7 +34,7 @@ Features: daemon mode . . . . . $enable_daemon -@@ -5940,6 +5946,7 @@ Configuration: +@@ -6016,6 +6022,7 @@ Configuration: iptables . . . . . . $enable_iptables ipvs . . . . . . . . $enable_ipvs irq . . . . . . . . . $enable_irq @@ -45,7 +45,7 @@ --- a/src/collectd.conf.in +++ b/src/collectd.conf.in @@ -128,6 +128,7 @@ - #@BUILD_PLUGIN_IPMI_TRUE@LoadPlugin ipmi + #@BUILD_PLUGIN_IPTABLES_TRUE@LoadPlugin iptables #@BUILD_PLUGIN_IPVS_TRUE@LoadPlugin ipvs #@BUILD_PLUGIN_IRQ_TRUE@LoadPlugin irq +#@BUILD_PLUGIN_IWINFO_TRUE@LoadPlugin iwinfo @@ -67,7 +67,7 @@ # JVMArg "-Djava.class.path=@prefix@/share/collectd/java/collectd-api.jar" --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod -@@ -2572,6 +2572,27 @@ and all other interrupts are collected. +@@ -2608,6 +2608,27 @@ and all other interrupts are collected. =back @@ -250,13 +250,13 @@ +} --- a/src/Makefile.am +++ b/src/Makefile.am -@@ -459,6 +459,13 @@ irq_la_SOURCES = irq.c \ +@@ -454,6 +454,13 @@ irq_la_SOURCES = irq.c irq_la_LDFLAGS = $(PLUGIN_LDFLAGS) endif +if BUILD_PLUGIN_IWINFO +pkglib_LTLIBRARIES += iwinfo.la -+iwinfo_la_SOURCES = iwinfo.c utils_ignorelist.c utils_ignorelist.h ++iwinfo_la_SOURCES = iwinfo.c +iwinfo_la_LDFLAGS = -module -avoid-version +iwinfo_la_LIBADD = -liwinfo +endif @@ -266,7 +266,7 @@ java_la_SOURCES = java.c --- a/src/types.db +++ b/src/types.db -@@ -227,6 +227,7 @@ voltage value:GAUGE:U:U +@@ -228,6 +228,7 @@ voltage value:GAUGE:U:U vs_memory value:GAUGE:0:9223372036854775807 vs_processes value:GAUGE:0:65535 vs_threads value:GAUGE:0:65535 diff --git a/utils/collectd/patches/920-fix-ping-droprate.patch b/utils/collectd/patches/920-fix-ping-droprate.patch index 6cbdcda9ed..96a5c22bd3 100644 --- a/utils/collectd/patches/920-fix-ping-droprate.patch +++ b/utils/collectd/patches/920-fix-ping-droprate.patch @@ -1,6 +1,6 @@ --- a/src/ping.c +++ b/src/ping.c -@@ -656,7 +656,7 @@ static int ping_read (void) /* {{{ */ +@@ -658,7 +658,7 @@ static int ping_read (void) /* {{{ */ / ((double) (pkg_recv * (pkg_recv - 1)))); /* Calculate drop rate. */