summaryrefslogtreecommitdiff
path: root/net-mgmt
diff options
context:
space:
mode:
authorJosh Paetzel <jpaetzel@FreeBSD.org>2010-11-25 14:58:33 +0000
committerJosh Paetzel <jpaetzel@FreeBSD.org>2010-11-25 14:58:33 +0000
commite20f6fdb9ffefaf24112f18a2eb97d7108893e38 (patch)
tree0d9c400aad8b0dd82281ed9873226614232b07b2 /net-mgmt
parentChase libgda4 lib bump. (diff)
Add rc.d script to port
PR: ports/151398 Submitted by: Tom Judge <tom@tomjudge.com> Approved by: Maintainer timeout
Notes
Notes: svn path=/head/; revision=265139
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/softflowd/Makefile2
-rw-r--r--net-mgmt/softflowd/files/softflowd.in75
2 files changed, 77 insertions, 0 deletions
diff --git a/net-mgmt/softflowd/Makefile b/net-mgmt/softflowd/Makefile
index 5fcee6d889e7..628e639f5456 100644
--- a/net-mgmt/softflowd/Makefile
+++ b/net-mgmt/softflowd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= softflowd
PORTVERSION= 0.9.8
+PORTREVISION= 1
CATEGORIES= net-mgmt ipv6
MASTER_SITES= http://www2.mindrot.org/files/softflowd/
@@ -18,6 +19,7 @@ USE_GMAKE= yes
PLIST_FILES= sbin/softflowd sbin/softflowctl
MAN8= softflowd.8 softflowctl.8
PORTDOCS= README
+USE_RC_SUBR= softflowd
post-install:
.if !defined(NOPORTDOCS)
diff --git a/net-mgmt/softflowd/files/softflowd.in b/net-mgmt/softflowd/files/softflowd.in
new file mode 100644
index 000000000000..dd512de0c3ff
--- /dev/null
+++ b/net-mgmt/softflowd/files/softflowd.in
@@ -0,0 +1,75 @@
+
+#!/bin/sh
+
+# (c) 2010 Tom Judge
+
+# PROVIDE: softflowd
+# REQUIRE: NETWORKING
+# BEFORE: LOGIN
+# KEYWORD: shutdown
+
+# softflowd_enable="YES"
+# softflowd_interfaces="em0 em1"
+# softflowd_em0_collector="collector:1234"
+# softflowd_em1_collector="collector:1235"
+# softflowd_em0_timeouts="-t maxlife=300"
+# softflowd_em1_timeouts="-t maxlife=600"
+# softflowd_em0_max_states="16000"
+# softflowd_em1_max_states="17000"
+# softflowd_em0_extra_args=""
+# softflowd_em1_extra_args=""
+
+. "/etc/rc.subr"
+
+softflowd_enable=${softflowd_enable:-"NO"}
+softflowd_timeouts="-t maxlife=300"
+softflowd_max_states="16000"
+softflowd_extra_args=""
+
+name=softflowd
+rcvar=`set_rcvar`
+load_rc_config $name
+stop_cmd="softflowd_stop"
+command="/usr/local/sbin/softflowd"
+_pidprefix="/var/run/softflowd"
+
+if [ -n "$2" ]; then
+ profile="$2"
+ pidfile="${_pidprefix}.${profile}.pid"
+ ctlfile="${_pidprefix}.${profile}.ctl"
+ eval apache22_flags="\${apache22_${profile}_flags:-${apache22_flags}}"
+ eval softflowd_collector="\${softflowd_${profile}_collector}"
+ if [ "x${softflowd_collector}" = "x" ]; then
+ echo "ERROR: You must specify a collector to send data to."
+ exit 1
+ fi
+ eval softflowd_timeouts="\${softflowd_${profile}_timeouts:-${softflowd_timeouts}}"
+ eval softflowd_max_states="\${softflowd_${profile}_max_states:-${softflowd_max_states}}"
+ eval softflowd_extra_args="\${softflowd_${profile}_extra_args:-${softflowd_extra_args}}"
+ command_args="-i ${profile} -n ${softflowd_collector} -m ${softflowd_max_states} -p ${pidfile} -c ${ctlfile} ${softflowd_timeouts} ${softflowd_extra_args}"
+
+else
+ if [ "x${softflowd_interfaces}" != "x" -a "x$1" != "x" ]; then
+ for profile in ${softflowd_interfaces}; do
+ echo "===> softflowd profile: ${profile}"
+ /usr/local/etc/rc.d/softflowd $1 ${profile}
+ retcode="$?"
+ if [ "0${retcode}" -ne 0 ]; then
+ failed="${profile} (${retcode}) ${failed:-}"
+ else
+ success="${profile} ${success:-}"
+ fi
+ done
+ exit 0
+ fi
+fi
+
+softflowd_stop() {
+ /usr/local/sbin/softflowctl -c ${ctlfile} shutdown
+}
+
+
+run_rc_command "$1"
+
+
+