From 5ed9400f0435f5983ef0ac475f0753dca0521f6b Mon Sep 17 00:00:00 2001 From: Kurt Jaeger Date: Fri, 9 Feb 2018 19:15:42 +0000 Subject: net-mgmt/pmacct: update 1.6.1 -> 1.6.2, allow per-interface instances PR: 200786 Submitted by: Niels Kristensen Relnotes: http://www.pmacct.net/ChangeLog-1.6.2 --- net-mgmt/pmacct/Makefile | 2 +- net-mgmt/pmacct/distinfo | 6 ++-- net-mgmt/pmacct/files/pkg-message.in | 9 +++--- net-mgmt/pmacct/files/pmacctd.in | 60 ++++++++++++++++++++++++++---------- net-mgmt/pmacct/pkg-plist | 3 +- 5 files changed, 54 insertions(+), 26 deletions(-) (limited to 'net-mgmt/pmacct') diff --git a/net-mgmt/pmacct/Makefile b/net-mgmt/pmacct/Makefile index 900f6baebafd..f8a172e3e5b8 100644 --- a/net-mgmt/pmacct/Makefile +++ b/net-mgmt/pmacct/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= pmacct -DISTVERSION= 1.6.1 +DISTVERSION= 1.6.2 PORTREVISION= 0 CATEGORIES= net-mgmt MASTER_SITES= http://www.pmacct.net/ diff --git a/net-mgmt/pmacct/distinfo b/net-mgmt/pmacct/distinfo index 093ee8276804..b1594e6a9e30 100644 --- a/net-mgmt/pmacct/distinfo +++ b/net-mgmt/pmacct/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1490125463 -SHA256 (pmacct-1.6.1.tar.gz) = eb332a6812d1e02134900a1d115a24f315de7c861a9b63093c1226753486cbe7 -SIZE (pmacct-1.6.1.tar.gz) = 1280968 +TIMESTAMP = 1518121340 +SHA256 (pmacct-1.6.2.tar.gz) = e6ede7f500fb1771b5cdfb63dfa016e34c19b8aa2d2f672bd4c63016a5d6bbe2 +SIZE (pmacct-1.6.2.tar.gz) = 1311678 diff --git a/net-mgmt/pmacct/files/pkg-message.in b/net-mgmt/pmacct/files/pkg-message.in index 7d84ec14b37f..69d287752486 100644 --- a/net-mgmt/pmacct/files/pkg-message.in +++ b/net-mgmt/pmacct/files/pkg-message.in @@ -3,11 +3,12 @@ Please note that this port requires configuration before it will function Add these to /etc/rc.conf: pmacctd_enable="YES" -pmacctd_flags="-Df %%PREFIX%%/etc/pmacctd.conf -i " +pmacctd_interfaces="em0 em1" -Configuration examples are located in %%EXAMPLESDIR%%. You must copy -one of these to %%PREFIX%%/etc/pmacctd.conf and make any required edits -for your environment. +Configuration examples are located in %%EXAMPLESDIR%%. + +You should copy one of these to %%PREFIX%%/etc/pmacct/ +and adapt them for your environment. Database-related files/information can be found in %%DATADIR%%. diff --git a/net-mgmt/pmacct/files/pmacctd.in b/net-mgmt/pmacct/files/pmacctd.in index 2ecf396fb05d..4e34564294d4 100644 --- a/net-mgmt/pmacct/files/pmacctd.in +++ b/net-mgmt/pmacct/files/pmacctd.in @@ -4,35 +4,61 @@ # # PROVIDE: pmacctd -# REQUIRE: NETWORKING +# REQUIRE: DAEMON +# BEFORE: LOGIN # KEYWORD: shutdown -# -# Add the following lines to /etc/rc.conf to enable pmacctd: -# -# pmacctd_enable="YES" -# # You can define flags for pmacctd running. # See http://wiki.pmacct.net/OfficialConfigKeys for more details. # -# Example: -# pmacctd_flags="-f %%PREFIX%%/etc/pmacctd.conf -i em0" +# pmacctd_enable (bool): Set to YES to enable pmacctd +# Default: NO +# pmacctd_flags (str): Extra flags passed to pmacctd +# Default: -D +# pmacctd_conf (str): pmacctd configuration file +# Default: %%PREFIX%%/etc/pmacctd.conf # -# Default flags: -f %%PREFIX%%/etc/pmacctd.conf +# To enable multi interface, use: +# pmacctd_interfaces="em0 em1" # +# defaults will follow, pmacctd_conf becomes 'pmacctd_em0_conf', etc. . /etc/rc.subr -name=pmacctd +name="pmacctd" rcvar=pmacctd_enable -command=%%PREFIX%%/sbin/$name -command_args="-D" +command="%%PREFIX%%/sbin/$name" -# set defaults +load_rc_config $name -pmacctd_enable=${pmacctd_enable:-"NO"} -pmacctd_flags=${pmacctd_flags:-"-f %%PREFIX%%/etc/pmacctd.conf"} -load_rc_config $name -run_rc_command "$1" +[ -z "$pmacctd_enable" ] && pmacctd_enable="NO" +[ -z "$pmacctd_conf" ] && pmacctd_conf="%%PREFIX%%/etc/pmacctd.conf" +[ -z "$pmacctd_flags" ] && pmacctd_flags="-D" + +[ -n "$pmacctd_conf" ] && pmacctd_flags="$pmacctd_flags -f $pmacctd_conf" + +if [ -n "$pmacctd_interfaces" ]; then + _1=$1 + if [ $# -gt 1 ]; then shift; pmacctd_interfaces=$*; fi + pmacctd_conf="" + pmacctd_flags="" + rc=0 + for i in ${pmacctd_interfaces}; do + eval _conf=\$pmacctd_${i}_conf + eval _flags=\$pmacctd_${i}_flags + [ -z "$_conf" ] && _conf="%%PREFIX%%/etc/pmacct/$i" + [ -z "$_flags" ] && _flags="-D" + eval pidfile="/var/run/pmacct/${i}.pid" + + command_args="$_flags -F $pidfile -f $_conf -i $i" + run_rc_command "$_1" + if [ $? -ne 0 ]; then rc=1; fi + unset _pidcmd _rc_restart_done + done + exit $rc +else + run_rc_command "$1" +fi + diff --git a/net-mgmt/pmacct/pkg-plist b/net-mgmt/pmacct/pkg-plist index 008d0e8a6afb..613caa564124 100644 --- a/net-mgmt/pmacct/pkg-plist +++ b/net-mgmt/pmacct/pkg-plist @@ -24,6 +24,7 @@ sbin/sfacctd %%PORTEXAMPLES%%%%EXAMPLESDIR%%/agent_to_peer.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/allow-list.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/amqp/amqp_receiver.py +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/avro/avro_file_decoder.py %%PORTEXAMPLES%%%%EXAMPLESDIR%%/bgp_md5.lst.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/flow_to_rd.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/gnuplot-example.sh @@ -52,9 +53,9 @@ sbin/sfacctd %%PORTEXAMPLES%%%%EXAMPLESDIR%%/sampling.map.example %%PORTEXAMPLES%%%%EXAMPLESDIR%%/tee_receivers.lst.example %%DATADIR%%/README.64bit +%%DATADIR%%/README.GeoIP %%DATADIR%%/README.IPv6 %%DATADIR%%/README.cos -%%DATADIR%%/README.country %%DATADIR%%/README.custom_primitives %%DATADIR%%/README.etype %%DATADIR%%/README.export_proto -- cgit v1.2.3