X-Original-To: alpine-devel@lists.alpinelinux.org Delivered-To: alpine-devel@mail.alpinelinux.org Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mail.alpinelinux.org (Postfix) with ESMTPS id 91B9FDC1A4F for ; Wed, 21 Mar 2012 13:42:01 +0000 (UTC) Received: by lagv3 with SMTP id v3so1093265lag.13 for ; Wed, 21 Mar 2012 06:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=rv/olNeWzdkQXY11OEaSe+VkTUUnz8a24LQe7CuiDQM=; b=CqfXTfzebBYJNZkeFiHT/F+BJvYcW7M22tej+ww/9HOiHxA+aPYnM6UdDvwQnjYirc 0GAtse5wTYlYhpUj6R8vzRkNml6hqT3JclCXvSqM4NPdQZ09fd8hcNHgnaTPhLdfDv+B fLErnnLj6TjE1uBnChamoboMOjQ8Zj0/uCfDeRav1Eq0d/8RCZciUXWp0D8ZySQsx3JF aQA+gWx/eNOMI6dNGDJkzitnD9fTCzNLjQtiAKaqEhzykvD41Z9o0YdkJXG601gPNPzp hPmbJb4I2daA9H2beporyqoVKJYi20Jopg5v5ijhX8gDSqIGCyrNvavU75tCWmnRNDxY tJ7Q== Received: by 10.112.26.37 with SMTP id i5mr1482251lbg.6.1332337319545; Wed, 21 Mar 2012 06:41:59 -0700 (PDT) Received: from mh-netbook.swe.wtbts.net ([83.145.30.130]) by mx.google.com with ESMTPS id gw17sm1755871lab.11.2012.03.21.06.41.57 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 21 Mar 2012 06:41:58 -0700 (PDT) From: Mika Havela To: alpine-devel@lists.alpinelinux.org Cc: Mika Havela Subject: [alpine-devel] [PATCH] testing/rrdcollect: Version bump. Init.d scripts. Patching default rrdcollect.conf to work with alpine linux Date: Wed, 21 Mar 2012 14:41:41 +0100 Message-Id: <1332337301-30342-1-git-send-email-mika.havela@gmail.com> X-Mailer: git-send-email 1.7.9.3 X-Mailinglist: alpine-devel Precedence: list List-Id: Alpine Development List-Unsubscribe: List-Post: List-Help: List-Subscribe: --- testing/rrdcollect/APKBUILD | 35 +++++++++++++++++++---- testing/rrdcollect/rrdcollect.conf.patch | 46 ++++++++++++++++++++++++++++++ testing/rrdcollect/rrdcollect.confd | 3 ++ testing/rrdcollect/rrdcollect.initd | 27 ++++++++++++++++++ 4 files changed, 105 insertions(+), 6 deletions(-) create mode 100644 testing/rrdcollect/rrdcollect.conf.patch create mode 100644 testing/rrdcollect/rrdcollect.confd create mode 100755 testing/rrdcollect/rrdcollect.initd diff --git a/testing/rrdcollect/APKBUILD b/testing/rrdcollect/APKBUILD index 36e5597..688ccdd 100644 --- a/testing/rrdcollect/APKBUILD +++ b/testing/rrdcollect/APKBUILD @@ -1,7 +1,7 @@ # Contributor: Michael Mason # Maintainer: Michael Mason pkgname=rrdcollect -pkgver=0.2.4 +pkgver=0.2.9 pkgrel=1 pkgdesc="Read system statistical data and feed it to RRDtool" url="http://rrdcollect.sourceforge.net/" @@ -11,22 +11,45 @@ depends="rrdtool" makedepends="libpcap-dev" install= subpackages="$pkgname-doc" -source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz" +source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz +rrdcollect.conf.patch +rrdcollect.confd +rrdcollect.initd" + +_builddir="$srcdir/$pkgname-$pkgver" +prepare() { + cd "$_builddir" + for i in $source; do + case $i in + *.patch) + msg "Applying $i" + patch -p1 -i "$srcdir"/$i || return 1 + ;; + esac; + done +} build() { - cd "$srcdir/$pkgname-$pkgver" + cd "$_builddir" ./configure --prefix=/usr \ - --sysconfdir=/etc \ + --localstatedir=/var \ + --sysconfdir=/etc/rrdcollect \ --mandir=/usr/share/man \ --infodir=/usr/share/info make || return 1 } package() { - cd "$srcdir/$pkgname-$pkgver" + cd "$_builddir" make DESTDIR="$pkgdir" install + install -m755 -D "$srcdir"/rrdcollect.initd "$pkgdir"/etc/init.d/rrdcollect || return 1 + install -m644 -D "$srcdir"/rrdcollect.confd "$pkgdir"/etc/conf.d/rrdcollect || return 1 + install -m755 -d "$pkgdir"/var/lib/rrdtool || return 1 } -md5sums="fd7ac95195e3e5cbab0677629505d9be rrdcollect-0.2.4.tar.gz" +md5sums="1e94eb0f8d55ebf0f042c10baebc2d3d rrdcollect-0.2.9.tar.gz +e09d7a588e31c9ecfc44fd1747ad732b rrdcollect.conf.patch +b3f64ec3e4578fb4de9614c20c6ea232 rrdcollect.confd +edef974fb5a27279f9347d9eacda4a26 rrdcollect.initd" diff --git a/testing/rrdcollect/rrdcollect.conf.patch b/testing/rrdcollect/rrdcollect.conf.patch new file mode 100644 index 0000000..9b1d7b3 --- /dev/null +++ b/testing/rrdcollect/rrdcollect.conf.patch @@ -0,0 +1,46 @@ +--- rrdcollect-0.2.9.org/doc/sample-rrdcollect.conf ++++ rrdcollect-0.2.9/doc/sample-rrdcollect.conf +@@ -4,12 +4,12 @@ + # Configuration values: + + #step = 60 +-#directory = /var/lib/rrdtool ++directory = /var/lib/rrdtool + #loglevel = LOG_NOTICE + + # System statistics: + file:///proc/stat +-"cpu %d %d %d %d" stat.rrd:cpu_user,cpu_nice,cpu_system,cpu_idle ++"cpu %d %d %d %d %d %d %d" stat.rrd:cpu_user,cpu_nice,cpu_system,cpu_idle,cpu_iowait,cpu_irq,cpu_softirq + "ctxt %u" stat.rrd:ctxt + "page %u %u" stat.rrd:page_in,page_out + "processes %u" stat.rrd:processes +@@ -21,15 +21,15 @@ + "Swap: %*d %d %*d" memory.rrd:swap_used + + # S.M.A.R.T. HDD temperature: +-file:///proc/ide/hda/smart_values +-7:"%*04x %*04x %02x%*02x" temperature.rrd:hda +-file:///proc/ide/hdb/smart_values +-7:"%*04x %*04x %02x%*02x" temperature.rrd:hdb ++#file:///proc/ide/hda/smart_values ++#7:"%*04x %*04x %02x%*02x" temperature.rrd:hda ++#file:///proc/ide/hdb/smart_values ++#7:"%*04x %*04x %02x%*02x" temperature.rrd:hdb + + # Net: statistics + file:///proc/net/dev + " eth0: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth0.rrd:bytes_in,pkts_in,bytes_out,pkts_out +-" eth1: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth1.rrd:bytes_in,pkts_in,bytes_out,pkts_out ++#" eth1: %d %d %*d %*d %*d %*d %*d %*d %d %d" eth1.rrd:bytes_in,pkts_in,bytes_out,pkts_out + + # NEW! + # exec:/// -- instead of reading from /proc/ file data is read from +@@ -40,5 +40,5 @@ + # + # To use it, you must compile with --enable-exec + # Remember, programs run with root permissions. Use at your own risk. +-exec:///bin/df +-"/dev/hda1 %*d %d %d" hda1.rrd:used,empty ++#exec:///bin/df ++#"/dev/sda1 %*d %d %d" sda1.rrd:used,empty diff --git a/testing/rrdcollect/rrdcollect.confd b/testing/rrdcollect/rrdcollect.confd new file mode 100644 index 0000000..eb7e4fa --- /dev/null +++ b/testing/rrdcollect/rrdcollect.confd @@ -0,0 +1,3 @@ +# rrdcollect params suitable for running as a daemon + +RRD_OPTS="" diff --git a/testing/rrdcollect/rrdcollect.initd b/testing/rrdcollect/rrdcollect.initd new file mode 100755 index 0000000..da56611 --- /dev/null +++ b/testing/rrdcollect/rrdcollect.initd @@ -0,0 +1,27 @@ +#!/sbin/runscript + +description="rrdcollect daemon" +pidfile="/var/run/${RC_SVCNAME}.pid" +command="/usr/sbin/rrdcollect" +runas="root" + +start_pre() { + checkpath --directory --owner ${runas}:${runas} --mode 775 ${pidfile%/*} +} + +start() { + ebegin "Starting ${RC_SVCNAME}" + start-stop-daemon --start \ + --user ${runas} \ + --pidfile ${pidfile} \ + --exec ${command} \ + -- ${RRD_OPTS} + eend $? +} + +stop() { + ebegin "Stopping ${RC_SVCNAME}" + start-stop-daemon --stop \ + --pidfile ${pidfile} + eend $? +} -- 1.7.9.3 --- Unsubscribe: alpine-devel+unsubscribe@lists.alpinelinux.org Help: alpine-devel+help@lists.alpinelinux.org ---