summaryrefslogtreecommitdiff
path: root/net-analyzer/flow-tools/files/flowcapture.initd
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /net-analyzer/flow-tools/files/flowcapture.initd
reinit the tree, so we can have metadata
Diffstat (limited to 'net-analyzer/flow-tools/files/flowcapture.initd')
-rw-r--r--net-analyzer/flow-tools/files/flowcapture.initd30
1 files changed, 30 insertions, 0 deletions
diff --git a/net-analyzer/flow-tools/files/flowcapture.initd b/net-analyzer/flow-tools/files/flowcapture.initd
new file mode 100644
index 000000000000..c6fc34728799
--- /dev/null
+++ b/net-analyzer/flow-tools/files/flowcapture.initd
@@ -0,0 +1,30 @@
+#!/sbin/openrc-run
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+PORT=${PORT:=2055}
+# The daemon takes the pidfile argument and APPENDS .$PORT itself in writing.
+# It may have multiple children by original design, but this is not recommended
+# for Gentoo at this time.
+PIDFILE_BASE=${PIDFILE_BASE:=/run/flows/flowcapture.pid}
+PIDFILE=${PIDFILE:=${PIDFILE_BASE}.${PORT}}
+
+depend() {
+ use net
+}
+
+start() {
+ ebegin "Starting flow-capture"
+ checkpath -d -o flows /run/flows
+ start-stop-daemon --start --user ${USER} --exec /usr/bin/flow-capture \
+ --pidfile ${PIDFILE} \
+ -- ${FLOW_OPTS} >/dev/null 2>&1
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping flow-capture"
+ start-stop-daemon --stop --quiet --exec /usr/bin/flow-capture \
+ --pidfile ${PIDFILE}
+ eend $?
+}