added my Recipes
This commit is contained in:
@@ -0,0 +1,53 @@
|
||||
From 090a17ca338a9311d682ecc5933b32bff67cf07f Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 27 Jul 2019 14:20:14 -0700
|
||||
Subject: [PATCH] Remove including sys/sysctl.h on glibc based systems
|
||||
|
||||
Glibc 2.30 has added deprecation notice and collectd detects it as
|
||||
warning [1]
|
||||
|
||||
Fixes
|
||||
sys/sysctl.h:21:2: error: "The <sys/sysctl.h> header is deprecated and
|
||||
will be removed." [-Werror,-W#warnings]
|
||||
|
||||
[1]
|
||||
https://sourceware.org/git/?p=glibc.git;a=commit;h=744e829637162bb7d5029632aacf341c64b86990
|
||||
|
||||
Upstream-Status: Submitted
|
||||
[https://github.com/collectd/collectd/pull/3234]
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/processes.c | 2 +-
|
||||
src/uptime.c | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/processes.c b/src/processes.c
|
||||
index f83913a..9f71511 100644
|
||||
--- a/src/processes.c
|
||||
+++ b/src/processes.c
|
||||
@@ -87,7 +87,7 @@
|
||||
#if HAVE_MACH_VM_PROT_H
|
||||
#include <mach/vm_prot.h>
|
||||
#endif
|
||||
-#if HAVE_SYS_SYSCTL_H
|
||||
+#if defined(HAVE_SYS_SYSCTL_H) && !defined(__GLIBC__)
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
/* #endif HAVE_THREAD_INFO */
|
||||
diff --git a/src/uptime.c b/src/uptime.c
|
||||
index 0892bda..4b15150 100644
|
||||
--- a/src/uptime.c
|
||||
+++ b/src/uptime.c
|
||||
@@ -33,7 +33,7 @@
|
||||
*/
|
||||
/* #endif HAVE_LIBKSTAT */
|
||||
|
||||
-#elif HAVE_SYS_SYSCTL_H
|
||||
+#elif defined(HAVE_SYS_SYSCTL_H) && !defined(__GLIBC__)
|
||||
#include <sys/sysctl.h>
|
||||
/* Using sysctl interface to retrieve the boot time on *BSD / Darwin / OS X
|
||||
* systems */
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
From b0a64db90a24469e36978c748417ebe456b34d59 Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Sat, 22 Apr 2017 11:54:57 -0700
|
||||
Subject: [PATCH] configure: Check for -Wno-error=format-truncation compiler
|
||||
option
|
||||
|
||||
If this option is supported by compiler then disable it ( gcc7+)
|
||||
Use -Werror to elevate the warning to an error in case compiler like clang
|
||||
which warn about unknown options but not error out unless asked for
|
||||
|
||||
Fixes
|
||||
client.c:834:23: error: '%s' directive output may be truncated writing up to 1023 bytes into a region of size 1010 [-Werror=format-truncation=]
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
---
|
||||
configure.ac | 1 +
|
||||
m4/ax_check_compile_flag.m4 | 74 +++++++++++++++++++++++++++++++++++++
|
||||
2 files changed, 75 insertions(+)
|
||||
create mode 100644 m4/ax_check_compile_flag.m4
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a7eca97d..560eb988 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -7101,6 +7101,7 @@ if test "x$GCC" = "xyes"; then
|
||||
AM_CXXFLAGS="$AM_CXXFLAGS -Werror"
|
||||
fi
|
||||
fi
|
||||
+AX_CHECK_COMPILE_FLAG([-Werror -Werror=format-truncation],[AM_CFLAGS="$AM_CFLAGS -Wno-error=format-truncation" AM_CXXFLAGS="$AM_CXXFLAGS -Wno-error=format-truncation"])
|
||||
|
||||
AC_SUBST([AM_CFLAGS])
|
||||
AC_SUBST([AM_CXXFLAGS])
|
||||
diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4
|
||||
new file mode 100644
|
||||
index 00000000..dcabb92a
|
||||
--- /dev/null
|
||||
+++ b/m4/ax_check_compile_flag.m4
|
||||
@@ -0,0 +1,74 @@
|
||||
+# ===========================================================================
|
||||
+# https://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html
|
||||
+# ===========================================================================
|
||||
+#
|
||||
+# SYNOPSIS
|
||||
+#
|
||||
+# AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT])
|
||||
+#
|
||||
+# DESCRIPTION
|
||||
+#
|
||||
+# Check whether the given FLAG works with the current language's compiler
|
||||
+# or gives an error. (Warnings, however, are ignored)
|
||||
+#
|
||||
+# ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
|
||||
+# success/failure.
|
||||
+#
|
||||
+# If EXTRA-FLAGS is defined, it is added to the current language's default
|
||||
+# flags (e.g. CFLAGS) when the check is done. The check is thus made with
|
||||
+# the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to
|
||||
+# force the compiler to issue an error when a bad flag is given.
|
||||
+#
|
||||
+# INPUT gives an alternative input source to AC_COMPILE_IFELSE.
|
||||
+#
|
||||
+# NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this
|
||||
+# macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG.
|
||||
+#
|
||||
+# LICENSE
|
||||
+#
|
||||
+# Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
|
||||
+# Copyright (c) 2011 Maarten Bosmans <mkbosmans@gmail.com>
|
||||
+#
|
||||
+# This program is free software: you can redistribute it and/or modify it
|
||||
+# under the terms of the GNU General Public License as published by the
|
||||
+# Free Software Foundation, either version 3 of the License, or (at your
|
||||
+# option) any later version.
|
||||
+#
|
||||
+# This program is distributed in the hope that it will be useful, but
|
||||
+# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
|
||||
+# Public License for more details.
|
||||
+#
|
||||
+# You should have received a copy of the GNU General Public License along
|
||||
+# with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
+#
|
||||
+# As a special exception, the respective Autoconf Macro's copyright owner
|
||||
+# gives unlimited permission to copy, distribute and modify the configure
|
||||
+# scripts that are the output of Autoconf when processing the Macro. You
|
||||
+# need not follow the terms of the GNU General Public License when using
|
||||
+# or distributing such scripts, even though portions of the text of the
|
||||
+# Macro appear in them. The GNU General Public License (GPL) does govern
|
||||
+# all other use of the material that constitutes the Autoconf Macro.
|
||||
+#
|
||||
+# This special exception to the GPL applies to versions of the Autoconf
|
||||
+# Macro released by the Autoconf Archive. When you make and distribute a
|
||||
+# modified version of the Autoconf Macro, you may extend this special
|
||||
+# exception to the GPL to apply to your modified version as well.
|
||||
+
|
||||
+#serial 5
|
||||
+
|
||||
+AC_DEFUN([AX_CHECK_COMPILE_FLAG],
|
||||
+[AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF
|
||||
+AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl
|
||||
+AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [
|
||||
+ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS
|
||||
+ _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
|
||||
+ AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])],
|
||||
+ [AS_VAR_SET(CACHEVAR,[yes])],
|
||||
+ [AS_VAR_SET(CACHEVAR,[no])])
|
||||
+ _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
|
||||
+AS_VAR_IF(CACHEVAR,yes,
|
||||
+ [m4_default([$2], :)],
|
||||
+ [m4_default([$3], :)])
|
||||
+AS_VAR_POPDEF([CACHEVAR])dnl
|
||||
+])dnl AX_CHECK_COMPILE_FLAGS
|
||||
@@ -0,0 +1,24 @@
|
||||
Subject: fix to build with glibc 2.25
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
|
||||
---
|
||||
src/md.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/md.c b/src/md.c
|
||||
index 3725f9a..202225b 100644
|
||||
--- a/src/md.c
|
||||
+++ b/src/md.c
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "utils/ignorelist/ignorelist.h"
|
||||
|
||||
#include <sys/ioctl.h>
|
||||
+#include <sys/sysmacros.h>
|
||||
|
||||
#include <linux/major.h>
|
||||
#include <linux/raid/md_u.h>
|
||||
--
|
||||
2.8.3
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
From f82f8faf9942f51e9c3c773b56574652695bef5a Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Wed, 9 May 2018 21:45:38 -0700
|
||||
Subject: [PATCH] Disable new gcc8 warnings
|
||||
|
||||
GCC seems to be not able to detect the checks for size are
|
||||
already in place
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
|
||||
---
|
||||
src/libcollectdclient/network_parse.c | 7 +++++++
|
||||
src/write_sensu.c | 7 +++++++
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c
|
||||
index aa753ce..fef43a9 100644
|
||||
--- a/src/libcollectdclient/network_parse.c
|
||||
+++ b/src/libcollectdclient/network_parse.c
|
||||
@@ -148,6 +148,11 @@ static int parse_int(void *payload, size_t payload_size, uint64_t *out) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#pragma GCC diagnostic push
|
||||
+#if __GNUC__ == 8
|
||||
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
+#endif
|
||||
+
|
||||
static int parse_string(void *payload, size_t payload_size, char *out,
|
||||
size_t out_size) {
|
||||
char *in = payload;
|
||||
@@ -160,6 +165,8 @@ static int parse_string(void *payload, size_t payload_size, char *out,
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#pragma GCC diagnostic pop
|
||||
+
|
||||
static int parse_identifier(uint16_t type, void *payload, size_t payload_size,
|
||||
lcc_value_list_t *state) {
|
||||
char buf[LCC_NAME_LEN];
|
||||
diff --git a/src/write_sensu.c b/src/write_sensu.c
|
||||
index bd7a56d..6cb59d5 100644
|
||||
--- a/src/write_sensu.c
|
||||
+++ b/src/write_sensu.c
|
||||
@@ -570,6 +570,11 @@ static char *sensu_value_to_json(struct sensu_host const *host, /* {{{ */
|
||||
return ret_str;
|
||||
} /* }}} char *sensu_value_to_json */
|
||||
|
||||
+#pragma GCC diagnostic push
|
||||
+#if __GNUC__ > 7
|
||||
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
+#endif
|
||||
/*
|
||||
* Uses replace_str2() implementation from
|
||||
* http://creativeandcritical.net/str-replace-c/
|
||||
@@ -632,6 +637,8 @@ static char *replace_str(const char *str, const char *old, /* {{{ */
|
||||
return ret;
|
||||
} /* }}} char *replace_str */
|
||||
|
||||
+#pragma GCC diagnostic pop
|
||||
+
|
||||
static char *replace_json_reserved(const char *message) /* {{{ */
|
||||
{
|
||||
char *msg = replace_str(message, "\\", "\\\\");
|
||||
@@ -0,0 +1,31 @@
|
||||
From 98719ea7f717750c790a1f9384ea8d0117e7f52d Mon Sep 17 00:00:00 2001
|
||||
From: Khem Raj <raj.khem@gmail.com>
|
||||
Date: Mon, 17 Dec 2018 18:15:05 -0800
|
||||
Subject: [PATCH] libcollectdclient: Fix string overflow errors
|
||||
|
||||
Ensure that string has a space for ending null char
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||
---
|
||||
src/libcollectdclient/network_parse.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/libcollectdclient/network_parse.c b/src/libcollectdclient/network_parse.c
|
||||
index fef43a9..6d65266 100644
|
||||
--- a/src/libcollectdclient/network_parse.c
|
||||
+++ b/src/libcollectdclient/network_parse.c
|
||||
@@ -169,9 +169,9 @@ static int parse_string(void *payload, size_t payload_size, char *out,
|
||||
|
||||
static int parse_identifier(uint16_t type, void *payload, size_t payload_size,
|
||||
lcc_value_list_t *state) {
|
||||
- char buf[LCC_NAME_LEN];
|
||||
-
|
||||
- if (parse_string(payload, payload_size, buf, sizeof(buf)) != 0)
|
||||
+ char buf[LCC_NAME_LEN+1];
|
||||
+ buf[LCC_NAME_LEN] = '\0';
|
||||
+ if (parse_string(payload, payload_size, buf, LCC_NAME_LEN) != 0)
|
||||
return EINVAL;
|
||||
|
||||
switch (type) {
|
||||
@@ -0,0 +1,212 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# collectd - start and stop the statistics collection daemon
|
||||
# http://collectd.org/
|
||||
#
|
||||
# Copyright (C) 2005-2006 Florian Forster <octo@verplant.org>
|
||||
# Copyright (C) 2006-2009 Sebastian Harl <tokkee@debian.org>
|
||||
#
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: collectd
|
||||
# Required-Start: $local_fs $remote_fs
|
||||
# Required-Stop: $local_fs $remote_fs
|
||||
# Should-Start: $network $named $syslog $time cpufrequtils
|
||||
# Should-Stop: $network $named $syslog
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 0 1 6
|
||||
# Short-Description: manage the statistics collection daemon
|
||||
# Description: collectd is the statistics collection daemon.
|
||||
# It is a small daemon which collects system information
|
||||
# periodically and provides mechanisms to monitor and store
|
||||
# the values in a variety of ways.
|
||||
### END INIT INFO
|
||||
|
||||
. /etc/init.d/functions
|
||||
|
||||
export PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
||||
|
||||
DISABLE=0
|
||||
|
||||
NAME=collectd
|
||||
DAEMON=/usr/sbin/collectd
|
||||
|
||||
CONFIGFILE=/etc/collectd.conf
|
||||
PIDFILE=/var/run/collectd.pid
|
||||
|
||||
USE_COLLECTDMON=1
|
||||
COLLECTDMON_DAEMON=/usr/sbin/collectdmon
|
||||
COLLECTDMON_PIDFILE=/var/run/collectdmon.pid
|
||||
|
||||
MAXWAIT=30
|
||||
|
||||
# Gracefully exit if the package has been removed.
|
||||
test -x $DAEMON || exit 0
|
||||
|
||||
if [ -r /etc/default/$NAME ]; then
|
||||
. /etc/default/$NAME
|
||||
fi
|
||||
|
||||
if test "$ENABLE_COREFILES" = 1; then
|
||||
ulimit -c unlimited
|
||||
fi
|
||||
|
||||
if test "$USE_COLLECTDMON" = 1; then
|
||||
_PIDFILE="$COLLECTDMON_PIDFILE"
|
||||
else
|
||||
_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
|
||||
echo "disabled by /etc/default/$NAME"
|
||||
return 3
|
||||
fi
|
||||
|
||||
if test ! -e "$CONFIGFILE"; then
|
||||
# we get here during restart
|
||||
echo "disabled, no configuration ($CONFIGFILE) found"
|
||||
return 3
|
||||
fi
|
||||
|
||||
check_config
|
||||
rc="$?"
|
||||
if test "$rc" -ne 0; then
|
||||
echo "not starting, configuration error"
|
||||
return 2
|
||||
fi
|
||||
|
||||
if test "$USE_COLLECTDMON" = 1; then
|
||||
start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \
|
||||
--exec $COLLECTDMON_DAEMON -- -P "$_PIDFILE" -- -C "$CONFIGFILE" \
|
||||
|| return 2
|
||||
else
|
||||
start-stop-daemon --start --quiet --oknodo --pidfile "$_PIDFILE" \
|
||||
--exec $DAEMON -- -C "$CONFIGFILE" -P "$_PIDFILE" \
|
||||
|| return 2
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
still_running_warning="
|
||||
WARNING: $NAME might still be running.
|
||||
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
|
||||
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile "$_PIDFILE"
|
||||
rc="$?"
|
||||
|
||||
if test "$rc" -eq 2; then
|
||||
return 2
|
||||
fi
|
||||
|
||||
sleep 1
|
||||
if test -n "$PID" && kill -0 $PID 2> /dev/null; then
|
||||
i=0
|
||||
while kill -0 $PID 2> /dev/null; do
|
||||
i=$(( $i + 2 ))
|
||||
echo -n " ."
|
||||
|
||||
if test $i -gt $MAXWAIT; then
|
||||
echo "$still_running_warning"
|
||||
return 2
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
done
|
||||
return "$rc"
|
||||
fi
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
# return:
|
||||
# 0 if the daemon is running
|
||||
# 3 if the daemon is stopped
|
||||
d_status(){
|
||||
if test "$USE_COLLECTDMON" = 1; then
|
||||
status $COLLECTDMON_DAEMON
|
||||
else
|
||||
status $DAEMON
|
||||
fi
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
echo -n "Starting $NAME"
|
||||
d_start
|
||||
case "$?" in
|
||||
0|1) echo "." ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
stop)
|
||||
echo -n "Stopping $NAME"
|
||||
d_stop
|
||||
case "$?" in
|
||||
0|1) echo "." ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
status)
|
||||
d_status
|
||||
;;
|
||||
restart|force-reload)
|
||||
echo -n "Restarting $NAME"
|
||||
check_config
|
||||
rc="$?"
|
||||
if test "$rc" -eq 1; then
|
||||
echo "not restarting, configuration error"
|
||||
exit 1
|
||||
fi
|
||||
d_stop
|
||||
rc="$?"
|
||||
case "$rc" in
|
||||
0|1)
|
||||
sleep 1
|
||||
d_start
|
||||
rc2="$?"
|
||||
case "$rc2" in
|
||||
0|1) echo "." ;;
|
||||
*) exit 1 ;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|restart|force-reload|status}" >&2
|
||||
exit 3
|
||||
;;
|
||||
esac
|
||||
|
||||
# vim: syntax=sh noexpandtab sw=4 ts=4 :
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
[Unit]
|
||||
Description=Collectd
|
||||
After=local-fs.target network.target
|
||||
Requires=local-fs.target network.target
|
||||
|
||||
[Service]
|
||||
ExecStart=@SBINDIR@/collectd -C /etc/collectd.conf -f
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,37 @@
|
||||
From d9b954bd9d0b084d9a1f5159a9f0c45802a51809 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Eggleton <paul.eggleton@linux.intel.com>
|
||||
Date: Mon, 22 Apr 2013 16:28:16 +0000
|
||||
|
||||
---
|
||||
configure.ac | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index e869a6a0..101d6f9f 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -2514,20 +2514,20 @@ AC_ARG_WITH([libgcrypt],
|
||||
if test -f "$withval" && test -x "$withval"; then
|
||||
with_libgcrypt_config="$withval"
|
||||
with_libgcrypt="yes"
|
||||
- else if test -f "$withval/bin/gcrypt-config" && test -x "$withval/bin/gcrypt-config"; then
|
||||
- with_libgcrypt_config="$withval/bin/gcrypt-config"
|
||||
+ else if test -f "$withval/bin/pkg-config" && test -x "$withval/bin/pkg-config"; then
|
||||
+ with_libgcrypt_config="$withval/bin/pkg-config"
|
||||
with_libgcrypt="yes"
|
||||
else if test -d "$withval"; then
|
||||
GCRYPT_CPPFLAGS="$GCRYPT_CPPFLAGS -I$withval/include"
|
||||
GCRYPT_LDFLAGS="$GCRYPT_LDFLAGS -L$withval/lib"
|
||||
with_libgcrypt="yes"
|
||||
else
|
||||
- with_libgcrypt_config="gcrypt-config"
|
||||
+ with_libgcrypt_config="pkg-config"
|
||||
with_libgcrypt="$withval"
|
||||
fi; fi; fi
|
||||
],
|
||||
[
|
||||
- with_libgcrypt_config="libgcrypt-config"
|
||||
+ with_libgcrypt_config="libpkg-config"
|
||||
with_libgcrypt="yes"
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,91 @@
|
||||
SUMMARY = "Collects and summarises system performance statistics"
|
||||
DESCRIPTION = "collectd is a daemon which collects system performance statistics periodically and provides mechanisms to store the values in a variety of ways, for example in RRD files."
|
||||
LICENSE = "GPL-2.0-only & MIT"
|
||||
LIC_FILES_CHKSUM = "file://COPYING;md5=1bd21f19f7f0c61a7be8ecacb0e28854"
|
||||
|
||||
DEPENDS = "rrdtool curl libpcap libxml2 yajl libgcrypt libtool lvm2"
|
||||
|
||||
SRC_URI = "http://collectd.org/files/collectd-${PV}.tar.bz2 \
|
||||
file://collectd.init \
|
||||
file://collectd.service \
|
||||
file://no-gcrypt-badpath.patch \
|
||||
file://0001-fix-to-build-with-glibc-2.25.patch \
|
||||
file://0001-configure-Check-for-Wno-error-format-truncation-comp.patch \
|
||||
file://0005-Disable-new-gcc8-warnings.patch \
|
||||
file://0006-libcollectdclient-Fix-string-overflow-errors.patch \
|
||||
file://0001-Remove-including-sys-sysctl.h-on-glibc-based-systems.patch \
|
||||
"
|
||||
SRC_URI[md5sum] = "2b23a65960bc323d065234776a542e04"
|
||||
SRC_URI[sha256sum] = "5bae043042c19c31f77eb8464e56a01a5454e0b39fa07cf7ad0f1bfc9c3a09d6"
|
||||
|
||||
inherit autotools python3native update-rc.d pkgconfig systemd
|
||||
|
||||
SYSTEMD_SERVICE:${PN} = "collectd.service"
|
||||
|
||||
# Floatingpoint layout, architecture dependent
|
||||
# 'nothing', 'endianflip' or 'intswap'
|
||||
FPLAYOUT ?= "--with-fp-layout=nothing"
|
||||
|
||||
PACKAGECONFIG ??= ""
|
||||
PACKAGECONFIG[openjdk] = "--with-java=${STAGING_DIR_TARGET}${libdir}/jvm,--without-java,openjdk-7"
|
||||
PACKAGECONFIG[snmp] = "--enable-snmp,--disable-snmp --with-libnetsnmp=no,net-snmp"
|
||||
PACKAGECONFIG[libmemcached] = "--with-libmemcached,--without-libmemcached,libmemcached"
|
||||
PACKAGECONFIG[iptables] = "--enable-iptables,--disable-iptables,iptables"
|
||||
PACKAGECONFIG[postgresql] = "--enable-postgresql --with-libpq=yes, \
|
||||
--disable-postgresql --with-libpq=no,postgresql"
|
||||
PACKAGECONFIG[mysql] = "--enable-mysql --with-libmysql=yes, \
|
||||
--disable-mysql --with-libmysql=no,mysql5"
|
||||
PACKAGECONFIG[dbi] = "--enable-dbi,--disable-dbi,libdbi"
|
||||
PACKAGECONFIG[modbus] = "--enable-modbus,--disable-modbus,libmodbus"
|
||||
PACKAGECONFIG[libowcapi] = "--with-libowcapi,--without-libowcapi,owfs"
|
||||
PACKAGECONFIG[sensors] = "--enable-sensors --with-libsensors=yes, \
|
||||
--disable-sensors --with-libsensors=no,lmsensors"
|
||||
PACKAGECONFIG[amqp] = "--enable-amqp --with-librabbitmq=yes, \
|
||||
--disable-amqp --with-librabbitmq=no,rabbitmq-c"
|
||||
# protobuf-c, libvirt that are currently only available in meta-virtualization layer
|
||||
PACKAGECONFIG[pinba] = "--enable-pinba,--disable-pinba,protobuf-c-native protobuf-c"
|
||||
PACKAGECONFIG[libvirt] = "--enable-virt,--disable-virt,libvirt"
|
||||
PACKAGECONFIG[libesmtp] = "--with-libesmtp,--without-libesmtp,libesmtp"
|
||||
PACKAGECONFIG[libmnl] = "--with-libmnl,--without-libmnl,libmnl"
|
||||
PACKAGECONFIG[libatasmart] = "--with-libatasmart,--without-libatasmart,libatasmart"
|
||||
PACKAGECONFIG[ldap] = "--enable-openldap --with-libldap,--disable-openldap --without-libldap, openldap"
|
||||
PACKAGECONFIG[rrdtool] = "--enable-rrdtool,--disable-rrdtool,rrdtool"
|
||||
PACKAGECONFIG[rrdcached] = "--enable-rrdcached,--disable-rrdcached,rrdcached"
|
||||
PACKAGECONFIG[python] = "--enable-python,--disable-python"
|
||||
|
||||
EXTRA_OECONF = " \
|
||||
${FPLAYOUT} \
|
||||
--disable-perl --with-libperl=no --with-perl-bindings=no \
|
||||
--with-libgcrypt=${STAGING_BINDIR_CROSS}/libgcrypt-config \
|
||||
--disable-notify_desktop --disable-werror \
|
||||
"
|
||||
|
||||
do_install:append() {
|
||||
install -d ${D}${sysconfdir}/init.d
|
||||
install -m 0755 ${WORKDIR}/collectd.init ${D}${sysconfdir}/init.d/collectd
|
||||
sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/collectd
|
||||
sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/collectd
|
||||
sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/collectd
|
||||
sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/collectd
|
||||
install -Dm 0640 ${B}/src/collectd.conf ${D}${sysconfdir}/collectd.conf
|
||||
# Fix configuration file to allow collectd to start up
|
||||
sed -i 's!^#FQDNLookup[ \t]*true!FQDNLookup false!g' ${D}${sysconfdir}/collectd.conf
|
||||
|
||||
rmdir ${D}${localstatedir}/run ${D}${localstatedir}/log
|
||||
rmdir --ignore-fail-on-non-empty ${D}${localstatedir}
|
||||
|
||||
# Install systemd unit files
|
||||
install -d ${D}${systemd_unitdir}/system
|
||||
install -m 0644 ${WORKDIR}/collectd.service ${D}${systemd_unitdir}/system
|
||||
sed -i -e 's,@SBINDIR@,${sbindir},g' \
|
||||
${D}${systemd_unitdir}/system/collectd.service
|
||||
}
|
||||
|
||||
CONFFILES:${PN} = "${sysconfdir}/collectd.conf"
|
||||
|
||||
INITSCRIPT_NAME = "collectd"
|
||||
INITSCRIPT_PARAMS = "defaults"
|
||||
|
||||
# threshold.so load.so are also provided by gegl
|
||||
# disk.so is also provided by libgphoto2-camlibs
|
||||
PRIVATE_LIBS = "threshold.so load.so disk.so"
|
||||
Reference in New Issue
Block a user