From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Markus Pargmann Date: Fri, 20 Jun 2014 12:49:22 +0200 Message-Id: <1403261362-6938-3-git-send-email-mpa@pengutronix.de> In-Reply-To: <1403261362-6938-1-git-send-email-mpa@pengutronix.de> References: <1403261362-6938-1-git-send-email-mpa@pengutronix.de> Subject: [ptxdist] [PATCH v3 3/3] collectd: Initial commit Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Markus Pargmann Signed-off-by: Markus Pargmann --- generic/lib/systemd/system/collectd.service | 10 +++ rules/collectd.in | 24 +++++++ rules/collectd.make | 107 ++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 generic/lib/systemd/system/collectd.service create mode 100644 rules/collectd.in create mode 100644 rules/collectd.make diff --git a/generic/lib/systemd/system/collectd.service b/generic/lib/systemd/system/collectd.service new file mode 100644 index 000000000000..e8100dff37f1 --- /dev/null +++ b/generic/lib/systemd/system/collectd.service @@ -0,0 +1,10 @@ +[Unit] +Description=statistics collection daemon +Documentation=man:collectd(1) +After=local-fs.target network.target +Requires=local-fs.target network.target + +[Service] +ExecStart=/usr/sbin/collectd -C /etc/collectd.conf -f +StandardOutput=syslog +StandardError=syslog diff --git a/rules/collectd.in b/rules/collectd.in new file mode 100644 index 000000000000..a2fec6fcd45a --- /dev/null +++ b/rules/collectd.in @@ -0,0 +1,24 @@ +## SECTION=test_suites + +menuconfig COLLECTD + tristate + select LIBMNL + select RRDTOOL + select RRDTOOL_RRDCACHED + select LIBOPING + prompt "collectd " + help + collectd is a system monitor that records different system statistics + and writes it to rrdtool. + +if COLLECTD + +config COLLECTD_SYSTEMD_SERVICE + bool "install systemd service file for collectd" + default y + +config COLLECTD_SYSTEMD_SERVICE_ENABLE + bool "enable collectd systemd service" + default n + +endif diff --git a/rules/collectd.make b/rules/collectd.make new file mode 100644 index 000000000000..351044747a71 --- /dev/null +++ b/rules/collectd.make @@ -0,0 +1,107 @@ +# -*-makefile-*- +# +# Copyright (C) 2014 by Markus Pargmann +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_COLLECTD) += collectd + +# +# Paths and names +# +COLLECTD_VERSION := 5.4.1 +COLLECTD := collectd-$(COLLECTD_VERSION) +COLLECTD_SUFFIX := tar.bz2 +COLLECTD_URL := http://collectd.org/files/${COLLECTD}.${COLLECTD_SUFFIX} +COLLECTD_MD5 := 6f56c71c96573a7f4f7fb3bfab185974 +COLLECTD_DIR := $(BUILDDIR)/$(COLLECTD) +COLLECTD_SOURCE := $(SRCDIR)/$(COLLECTD).$(COLLECTD_SUFFIX) +COLLECTD_LICENSE := GPL2 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +#COLLECTD_CONF_ENV := $(CROSS_ENV) + +# +# autoconf +# +COLLECTD_CONF_TOOL := autoconf +COLLECTD_CONF_OPT := $(CROSS_AUTOCONF_USR) \ + --with-nan-emulation \ + --with-fp-layout=nothing \ + --without-java \ + --disable-all-plugins \ + --enable-contextswitch \ + --enable-cpu \ + --enable-cpufreq \ + --enable-disk \ + --enable-ethstat \ + --enable-exec \ + --enable-interface \ + --enable-irq \ + --enable-load \ + --enable-logfile \ + --enable-netlink \ + --enable-network \ + --enable-processes \ + --enable-protocols \ + --enable-rrdtool \ + --enable-table \ + --enable-uptime \ + --enable-wireless \ + --enable-ping + + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/collectd.targetinstall: + @$(call targetinfo) + + @$(call install_init, collectd) + @$(call install_fixup, collectd, PRIORITY, optional) + @$(call install_fixup, collectd, SECTION, base) + @$(call install_fixup, collectd, AUTHOR, "Markus Pargmann ") + @$(call install_fixup, collectd, DESCRIPTION, missing) + + + @for i in $(shell cd $(COLLECTD_PKGDIR) && find bin sbin usr/bin usr/sbin -type f); do \ + $(call install_copy, collectd, 0, 0, 0755, -, /$$i); \ + done + @for i in $(shell cd $(COLLECTD_PKGDIR) && find lib usr/lib -name "*.so*"); do \ + $(call install_copy, collectd, 0, 0, 0644, -, /$$i); \ + done + @links="$(shell cd $(COLLECTD_PKGDIR) && find lib usr/lib -type l)"; \ + if [ -n "$$links" ]; then \ + for i in $$links; do \ + from="`readlink $(COLLECTD_PKGDIR)/$$i`"; \ + to="/$$i"; \ + $(call install_link, collectd, $$from, $$to); \ + done; \ + fi + + @$(call install_alternative, collectd, 0, 0, 0644, /etc/collectd.conf) + + @$(call install_alternative, collectd, 0, 0, 0644, /usr/share/collectd/types.db) +ifdef PTXCONF_COLLECTD_SYSTEMD_SERVICE + @$(call install_alternative, collectd, 0, 0, 0644, /lib/systemd/system/collectd.service) +ifdef PTXCONF_COLLECTD_SYSTEMD_SERVICE_ENABLE + @$(call install_link, collectd, ../collectd.service, /lib/systemd/system/multi-user.target.wants/collectd.service) +endif +endif + + @$(call install_finish, collectd) + + @$(call touch) + +# vim: syntax=make -- 2.0.0 -- ptxdist mailing list ptxdist@pengutronix.de