1 |
commit: a3508c8b9bced6ce2ae49816022b85e2dcd9af2e |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 29 00:45:27 2016 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 29 00:45:44 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a3508c8b |
7 |
|
8 |
net-analyzer/flow-tools: get to the bottom of the weird pidfile behavior in the codebase, -p is not the full path!. |
9 |
|
10 |
Package-Manager: portage-2.2.28 |
11 |
|
12 |
net-analyzer/flow-tools/files/flowcapture.confd | 9 ++- |
13 |
net-analyzer/flow-tools/files/flowcapture.initd | 6 +- |
14 |
.../flow-tools/flow-tools-0.68.5.1-r8.ebuild | 75 ++++++++++++++++++++++ |
15 |
3 files changed, 86 insertions(+), 4 deletions(-) |
16 |
|
17 |
diff --git a/net-analyzer/flow-tools/files/flowcapture.confd b/net-analyzer/flow-tools/files/flowcapture.confd |
18 |
index 20a2385..e926d64 100644 |
19 |
--- a/net-analyzer/flow-tools/files/flowcapture.confd |
20 |
+++ b/net-analyzer/flow-tools/files/flowcapture.confd |
21 |
@@ -39,10 +39,13 @@ WORKDIR=/var/lib/flows/ft |
22 |
# user to run as |
23 |
USER=flows |
24 |
|
25 |
-# Pidfile |
26 |
-PIDFILE=/run/flows/flowcapture.pid.${PORT} |
27 |
+# Pidfile base |
28 |
+# The daemon takes the pidfile argument and APPENDS .$PORT itself in writing. |
29 |
+# It may have multiple children by original design, but this is not recommended |
30 |
+# for Gentoo at this time. |
31 |
+PIDFILE_BASE=${PIDFILE_BASE:=/run/flows/flowcapture.pid} |
32 |
|
33 |
# This pulls in the options above |
34 |
-FLOW_OPTS="-p $PIDFILE -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG" |
35 |
+FLOW_OPTS="-p $PIDFILE_BASE -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG" |
36 |
# Use below only if you have sorted out the STAT_INT problem |
37 |
#FLOW_OPTS="-p /run/flows/flowcapture.pid.$PORT -w $WORKDIR $LOCALIP/$REMOTEIP/$PORT -S $STAT_INT -V $FLOW_VER -E $SIZE -n $ROTATIONS -N $NEST -R $ROTATE_PROG" |
38 |
|
39 |
diff --git a/net-analyzer/flow-tools/files/flowcapture.initd b/net-analyzer/flow-tools/files/flowcapture.initd |
40 |
index e03d493..a31ed5e 100644 |
41 |
--- a/net-analyzer/flow-tools/files/flowcapture.initd |
42 |
+++ b/net-analyzer/flow-tools/files/flowcapture.initd |
43 |
@@ -3,7 +3,11 @@ |
44 |
# Distributed under the terms of the GNU General Public License v2 |
45 |
|
46 |
PORT=${PORT:=2055} |
47 |
-PIDFILE=${PIDFILE:=/run/flows/flowcapture.pid.${PORT}} |
48 |
+# The daemon takes the pidfile argument and APPENDS .$PORT itself in writing. |
49 |
+# It may have multiple children by original design, but this is not recommended |
50 |
+# for Gentoo at this time. |
51 |
+PIDFILE_BASE=${PIDFILE_BASE:=/run/flows/flowcapture.pid} |
52 |
+PIDFILE=${PIDFILE:=${PIDFILE}.${PORT}} |
53 |
|
54 |
depend() { |
55 |
use net |
56 |
|
57 |
diff --git a/net-analyzer/flow-tools/flow-tools-0.68.5.1-r8.ebuild b/net-analyzer/flow-tools/flow-tools-0.68.5.1-r8.ebuild |
58 |
new file mode 100644 |
59 |
index 0000000..087e3c9 |
60 |
--- /dev/null |
61 |
+++ b/net-analyzer/flow-tools/flow-tools-0.68.5.1-r8.ebuild |
62 |
@@ -0,0 +1,75 @@ |
63 |
+# Copyright 1999-2016 Gentoo Foundation |
64 |
+# Distributed under the terms of the GNU General Public License v2 |
65 |
+# $Id$ |
66 |
+ |
67 |
+EAPI=5 |
68 |
+inherit eutils user |
69 |
+ |
70 |
+DESCRIPTION="library and programs to process reports from NetFlow data" |
71 |
+HOMEPAGE="https://code.google.com/p/flow-tools/" |
72 |
+SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.bz2" |
73 |
+ |
74 |
+LICENSE="BSD GPL-2" |
75 |
+SLOT="0" |
76 |
+KEYWORDS="~amd64 ~ppc ~x86" |
77 |
+IUSE="debug libressl mysql postgres ssl static-libs" |
78 |
+ |
79 |
+RDEPEND="sys-apps/tcp-wrappers |
80 |
+ sys-libs/zlib |
81 |
+ mysql? ( virtual/mysql ) |
82 |
+ postgres? ( dev-db/postgresql:* ) |
83 |
+ ssl? ( |
84 |
+ !libressl? ( dev-libs/openssl:0= ) |
85 |
+ libressl? ( dev-libs/libressl:0= ) |
86 |
+ )" |
87 |
+ |
88 |
+DEPEND="${RDEPEND} |
89 |
+ sys-devel/flex |
90 |
+ sys-devel/bison" |
91 |
+ |
92 |
+DOCS=( ChangeLog README SECURITY TODO ) |
93 |
+ |
94 |
+pkg_setup() { |
95 |
+ enewgroup flows |
96 |
+ enewuser flows -1 -1 /var/lib/flows flows |
97 |
+} |
98 |
+ |
99 |
+src_prepare() { |
100 |
+ epatch "${FILESDIR}"/${P}-run.patch |
101 |
+ epatch "${FILESDIR}"/${P}-syslog.patch |
102 |
+} |
103 |
+ |
104 |
+src_configure() { |
105 |
+ econf \ |
106 |
+ $(use_enable static-libs static) \ |
107 |
+ $(usex mysql --with-mysql '') \ |
108 |
+ $(usex postgres --with-postgresql=yes --with-postgresql=no) \ |
109 |
+ $(usex ssl --with-openssl '') \ |
110 |
+ --sysconfdir=/etc/flow-tools |
111 |
+} |
112 |
+ |
113 |
+src_install() { |
114 |
+ default |
115 |
+ |
116 |
+ prune_libtool_files |
117 |
+ |
118 |
+ exeinto /var/lib/flows/bin |
119 |
+ doexe "${FILESDIR}"/linkme |
120 |
+ |
121 |
+ keepdir /var/lib/flows/ft |
122 |
+ |
123 |
+ newinitd "${FILESDIR}/flowcapture.initd" flowcapture |
124 |
+ newconfd "${FILESDIR}/flowcapture.confd" flowcapture |
125 |
+ |
126 |
+ fowners flows:flows /var/lib/flows |
127 |
+ fowners flows:flows /var/lib/flows/bin |
128 |
+ fowners flows:flows /var/lib/flows/ft |
129 |
+ |
130 |
+ fperms 0755 /var/lib/flows |
131 |
+ fperms 0755 /var/lib/flows/bin |
132 |
+} |
133 |
+ |
134 |
+pkg_preinst() { |
135 |
+ enewgroup flows |
136 |
+ enewuser flows -1 -1 /var/lib/flows flows |
137 |
+} |