From 8a1df176ce5a4d220752e4c4165992268e5922d2 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 3 Feb 2010 07:46:48 +0000 Subject: main/fprobe: move from testing --- main/fprobe/APKBUILD | 36 +++++++++++++++++++++++++ main/fprobe/fprobe.confd | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ main/fprobe/fprobe.initd | 40 +++++++++++++++++++++++++++ 3 files changed, 146 insertions(+) create mode 100644 main/fprobe/APKBUILD create mode 100644 main/fprobe/fprobe.confd create mode 100644 main/fprobe/fprobe.initd (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD new file mode 100644 index 0000000000..824129afe5 --- /dev/null +++ b/main/fprobe/APKBUILD @@ -0,0 +1,36 @@ +# Contributor: Carlo Landmeter +# Maintainer: Carlo Landmeter +pkgname=fprobe +pkgver=1.1 +pkgrel=2 +pkgdesc="libpcap-based tool that collect network traffic" +url="http://fprobe.sourceforge.net/" +license="GPL" +depends= +makedepends="libpcap-dev" +subpackages="$pkgname-doc" +source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 +$pkgname.initd +$pkgname.confd" + +_builddir="$srcdir"/$pkgname-$pkgver +build() { + cd "$_builddir" + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --mandir=/usr/share/man \ + --infodir=/usr/share/info + make || return 1 +} + +package() { + cd "$_builddir" + make DESTDIR="$pkgdir" install + + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname + install -m644 -D "$srcdir"/$pkgname.confd "$pkgdir"/etc/conf.d/$pkgname +} + +md5sums="65850d0470078269b33eee58cba77ac2 fprobe-1.1.tar.bz2 +41810a73503624de2c27809e34ed80b4 fprobe.initd +ba9c9327456e4db897b60481705df282 fprobe.confd" diff --git a/main/fprobe/fprobe.confd b/main/fprobe/fprobe.confd new file mode 100644 index 0000000000..1c444f554e --- /dev/null +++ b/main/fprobe/fprobe.confd @@ -0,0 +1,70 @@ +# Config file for /etc/init.d/fprobe + +# Do we want the interface in promiscous mode [yes/no] +#PROMISC=no + +# Interface +IFACE=eth0 + +# If configured, only capture packets matching this tcpdump expression +#FILTER="" + +# Flow state timers +#TIMER_EXPIRED=5 +#TIMER_FRAGMENTED=30 +#TIMER_IDLE=60 +#TIMER_ACTIVE=300 + +# This is the default and should be left unless you know what you are doing +#FLOW_VER=5 + +# local ip. if configured fprobe will use this as the source IP for sending ALL flow data +# If you want to specify a specific source address per collecter, customize it below +#LOCALIP= + +# SNMP iface id +SNMP_IFACE="${IFACE//eth}" + +# Maximum number of concurrent flows to track +# using a specified amount of memory +#MEMBULK=10000 +#MEMLIMIT= + +# Pending queue +#PENDING=100 + +# Kernel capture buffer size (kB) +#KERNBUF=1024 + +# Realtime priority [0=disabled, 1..99] +#RTPRIO=0 + +# Delay N nanoseconds after each B bytes +#DELAY="0:0" + +# How much of the start of each packet to grab +#SNAPLEN=256 + +# chroot() to this location after startup +CHROOT="/var/empty" + +# User to run as. must have perms to the pidfile directory /var/run/fprobe/ +USER=nobody + +# logging level for syslog (0=EMERG, ..., 6=INFO, 7=DEBUG) +#LOGLEVEL=6 + +# If you want to run multiple instances of fprobe, +# You MUST set this variable to a unique INTEGER for each one! +PIDFILE_ID='' + +# remote ip. this is where we send flows +REMOTEIP=127.0.0.1 +# port to listen on +PORT=2055 +# Collector type, see the manpage for valid types +TYPE='' + +# If you want multiple collectors, just specify each one here +COLLECTORS="${REMOTEIP}:${PORT}/${LOCALIP}/${TYPE}" + diff --git a/main/fprobe/fprobe.initd b/main/fprobe/fprobe.initd new file mode 100644 index 0000000000..a14f1e6bcc --- /dev/null +++ b/main/fprobe/fprobe.initd @@ -0,0 +1,40 @@ +#!/sbin/runscript +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +depend() { + need net + after firewall +} + +BIN=/usr/sbin/fprobe +PIDFILE_EXTRA="" +[ -n "$PIDFILE_ID" ] && PIDFILE_EXTRA="[$PIDFILE_ID]" +PIDFILE="/var/run/fprobe$PIDFILE_EXTRA.pid" + +start() { + ebegin "Starting fprobe" + local OPTS="" + [ "${PROMISC}" == "yes" ] || OPTS="${OPTS} -p" + [ -n "${FILTER}" ] && OPTS="${OPTS} -f '${FILTER}'" + for optname in i:IFACE s:TIMER_EXPIRED g:TIME_FRAGMENTED d:TIMER_IDLE \ + e:TIMER_ACTIVE n:FLOW_VER a:LOCALIP x:SNMP_IFACE b:MEMBULK \ + m:MEMLIMIT q:PENDING B:KERNBUF r:RTPRIO t:DELAY S:SNAPLEN \ + c:CHROOT u:USER v:LOGLEVEL ; do + opt="${optname/:*}" optvar="${optname/*:}" + eval optvalue="\$$optvar" + [ -n "$optvalue" ] && OPTS="${OPTS} -${opt} ${optvalue}" + done + OPTS="${OPTS} -l 1:${PIDFILE_ID} ${COLLECTORS}" + start-stop-daemon --start --exec $BIN \ + --pidfile ${PIDFILE} \ + -- ${OPTS} + eend $? +} + +stop() { + ebegin "Stopping fprobe" + start-stop-daemon --stop --quiet --exec $BIN \ + --pidfile ${PIDFILE} + eend $? +} -- cgit v1.2.3 From b4eecaf058de2e73819dff5e48cdbcf1eb3612ba Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 4 May 2010 08:26:51 +0000 Subject: main/[various]: bump pkgrel to force rebuild against nptl --- main/fprobe/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD index 824129afe5..f7311e98e3 100644 --- a/main/fprobe/APKBUILD +++ b/main/fprobe/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Carlo Landmeter pkgname=fprobe pkgver=1.1 -pkgrel=2 +pkgrel=3 pkgdesc="libpcap-based tool that collect network traffic" url="http://fprobe.sourceforge.net/" license="GPL" -- cgit v1.2.3 From c315da486a9ecf4b696be7bb982aeb0a9c0ecb0b Mon Sep 17 00:00:00 2001 From: Leonardo Arena Date: Fri, 26 Nov 2010 09:25:51 +0000 Subject: main/fprobe: fix pid creation --- main/fprobe/APKBUILD | 23 +++++++++++--- main/fprobe/fprobe-1.1-pidfile-sanity.patch | 48 +++++++++++++++++++++++++++++ main/fprobe/fprobe-1.1-setgroups.patch | 19 ++++++++++++ 3 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 main/fprobe/fprobe-1.1-pidfile-sanity.patch create mode 100644 main/fprobe/fprobe-1.1-setgroups.patch (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD index f7311e98e3..f5db4ea826 100644 --- a/main/fprobe/APKBUILD +++ b/main/fprobe/APKBUILD @@ -1,19 +1,32 @@ -# Contributor: Carlo Landmeter +# Contributor: Leonardo Arena # Maintainer: Carlo Landmeter pkgname=fprobe pkgver=1.1 -pkgrel=3 +pkgrel=4 pkgdesc="libpcap-based tool that collect network traffic" url="http://fprobe.sourceforge.net/" license="GPL" depends= makedepends="libpcap-dev" +install="" subpackages="$pkgname-doc" source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2 -$pkgname.initd -$pkgname.confd" + fprobe-1.1-pidfile-sanity.patch + fprobe-1.1-setgroups.patch + $pkgname.initd + $pkgname.confd" _builddir="$srcdir"/$pkgname-$pkgver + +prepare() { + cd $_builddir + for i in ../*.patch + do + msg "Applying $i" + patch -p1 < ../$i || exit 1 + done +} + build() { cd "$_builddir" ./configure --prefix=/usr \ @@ -32,5 +45,7 @@ package() { } md5sums="65850d0470078269b33eee58cba77ac2 fprobe-1.1.tar.bz2 +265c9d9c434df46fc224a1ce7051e27a fprobe-1.1-pidfile-sanity.patch +ba8632d883fb49e83ea16db67c50a69b fprobe-1.1-setgroups.patch 41810a73503624de2c27809e34ed80b4 fprobe.initd ba9c9327456e4db897b60481705df282 fprobe.confd" diff --git a/main/fprobe/fprobe-1.1-pidfile-sanity.patch b/main/fprobe/fprobe-1.1-pidfile-sanity.patch new file mode 100644 index 0000000000..e7c10bd98d --- /dev/null +++ b/main/fprobe/fprobe-1.1-pidfile-sanity.patch @@ -0,0 +1,48 @@ +If we are using the chroot() option or the setuid options, we must create the +pidfile before doing the chroot OR the setreuid. It's actually best for +start-stop-daemon if we create the pidfile from the master side of the fork() +before it exits, since most of the startup checks happen after the chroot() +unfortunetly. + +Signed-off-by: Robin H. Johnson + +diff -Nuar fprobe-1.1.orig/src/fprobe.c fprobe-1.1/src/fprobe.c +--- fprobe-1.1.orig/src/fprobe.c 2005-01-30 08:43:35.000000000 +0000 ++++ fprobe-1.1/src/fprobe.c 2008-03-16 20:51:24.000000000 +0000 +@@ -1379,7 +1379,8 @@ + + my_log_open(ident, verbosity, log_dest); + if (!(log_dest & 2)) { +- switch (fork()) { ++ pid_t childpid = fork(); ++ switch (childpid) { + case -1: + fprintf(stderr, "fork(): %s", strerror(errno)); + exit(1); +@@ -1392,6 +1393,12 @@ + break; + + default: ++ if (!(pidfile = fopen(pidfilepath, "w"))) ++ my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno)); ++ else { ++ fprintf(pidfile, "%ld\n", (long) childpid); ++ fclose(pidfile); ++ } + exit(0); + } + } else { +@@ -1548,13 +1555,6 @@ + } + } + +- if (!(pidfile = fopen(pidfilepath, "w"))) +- my_log(LOG_ERR, "Can't create pid file. fopen(): %s", strerror(errno)); +- else { +- fprintf(pidfile, "%ld\n", (long) pid); +- fclose(pidfile); +- } +- + my_log(LOG_INFO, "pid: %d", pid); + my_log(LOG_INFO, "interface: %s, datalink: %s (%d)", + dev, dlt[link_type_idx].descr, link_type); diff --git a/main/fprobe/fprobe-1.1-setgroups.patch b/main/fprobe/fprobe-1.1-setgroups.patch new file mode 100644 index 0000000000..9696812437 --- /dev/null +++ b/main/fprobe/fprobe-1.1-setgroups.patch @@ -0,0 +1,19 @@ +This seems to fail after the chroot(), so just squelch the exit for now. + +Signed-off-by: Robin H. Johnson + +diff -Nuar fprobe-1.1/src/fprobe.c fprobe-1.1.new/src/fprobe.c +--- fprobe-1.1/src/fprobe.c 2008-03-17 00:06:43.000000000 +0000 ++++ fprobe-1.1.new/src/fprobe.c 2008-03-17 00:07:30.000000000 +0000 +@@ -1541,10 +1541,10 @@ + } + + if (pw) { + if (setgroups(0, NULL) < 0) { + my_log(LOG_CRIT, "setgroups: %s", strerror(errno)); +- exit(1); ++ //exit(1); + } + if (setregid(pw->pw_gid, pw->pw_gid)) { + my_log(LOG_CRIT, "setregid(%u): %s", pw->pw_gid, strerror(errno)); + exit(1); -- cgit v1.2.3 From da49ad32c469ea4e9426a6ac6d8c2e1db97edda6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 13 Dec 2010 16:00:16 +0000 Subject: main/*: add arch --- main/fprobe/APKBUILD | 1 + 1 file changed, 1 insertion(+) (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD index f5db4ea826..e2d44bd242 100644 --- a/main/fprobe/APKBUILD +++ b/main/fprobe/APKBUILD @@ -5,6 +5,7 @@ pkgver=1.1 pkgrel=4 pkgdesc="libpcap-based tool that collect network traffic" url="http://fprobe.sourceforge.net/" +arch="x86 x86_64" license="GPL" depends= makedepends="libpcap-dev" -- cgit v1.2.3 From ba2600dc6ebad7a01bc96e7e01ad75ae4573d391 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 13 Jan 2011 06:05:19 -0600 Subject: Set all packages with arch="x86 x86_64" to arch="all". --- main/fprobe/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD index e2d44bd242..5066af3435 100644 --- a/main/fprobe/APKBUILD +++ b/main/fprobe/APKBUILD @@ -5,7 +5,7 @@ pkgver=1.1 pkgrel=4 pkgdesc="libpcap-based tool that collect network traffic" url="http://fprobe.sourceforge.net/" -arch="x86 x86_64" +arch="all" license="GPL" depends= makedepends="libpcap-dev" -- cgit v1.2.3 From 4ff65ef29982e116527adebdd7ad73a05719712a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 31 Mar 2011 13:43:08 +0000 Subject: main: mass-rebuild of packages missing arch in .PKGINFO this is needed for apk-tools-2.1 migration --- main/fprobe/APKBUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main/fprobe') diff --git a/main/fprobe/APKBUILD b/main/fprobe/APKBUILD index 5066af3435..a3cb020877 100644 --- a/main/fprobe/APKBUILD +++ b/main/fprobe/APKBUILD @@ -2,7 +2,7 @@ # Maintainer: Carlo Landmeter pkgname=fprobe pkgver=1.1 -pkgrel=4 +pkgrel=5 pkgdesc="libpcap-based tool that collect network traffic" url="http://fprobe.sourceforge.net/" arch="all" -- cgit v1.2.3