diff options
author | Rodrigo Osorio <rodrigo@FreeBSD.org> | 2015-01-27 06:04:39 +0800 |
---|---|---|
committer | Rodrigo Osorio <rodrigo@FreeBSD.org> | 2015-01-27 06:04:39 +0800 |
commit | 539bbf72e11bcf3eba245e9eb31a6cc37fc13e73 (patch) | |
tree | 0222b83f68d9cd15487593ecb3229aa348c10e24 /net | |
parent | e15611e1b525aa8db5752fb8462b69ff9140abc0 (diff) | |
download | freebsd-ports-gnome-539bbf72e11bcf3eba245e9eb31a6cc37fc13e73.tar.gz freebsd-ports-gnome-539bbf72e11bcf3eba245e9eb31a6cc37fc13e73.tar.zst freebsd-ports-gnome-539bbf72e11bcf3eba245e9eb31a6cc37fc13e73.zip |
Resurect net/balance, a generic TCP proxy with round robin features
PR: 193368
Submitted by: Chris Hutchinson <portmaster@bsdforge.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/Makefile | 1 | ||||
-rw-r--r-- | net/balance/Makefile | 25 | ||||
-rw-r--r-- | net/balance/distinfo | 2 | ||||
-rw-r--r-- | net/balance/files/balance.in | 96 | ||||
-rw-r--r-- | net/balance/pkg-descr | 9 | ||||
-rw-r--r-- | net/balance/pkg-plist | 2 |
6 files changed, 135 insertions, 0 deletions
diff --git a/net/Makefile b/net/Makefile index 89ed64c288cc..6118f3102adb 100644 --- a/net/Makefile +++ b/net/Makefile @@ -40,6 +40,7 @@ SUBDIR += avahi-sharp SUBDIR += axa SUBDIR += babeld + SUBDIR += balance SUBDIR += beacon SUBDIR += beanstalkd SUBDIR += belle-sip diff --git a/net/balance/Makefile b/net/balance/Makefile new file mode 100644 index 000000000000..f1aa527163d1 --- /dev/null +++ b/net/balance/Makefile @@ -0,0 +1,25 @@ +# Created by: Joseph Scott <joseph@randomnetworks.com> +# $FreeBSD$ + +PORTNAME= balance +PORTVERSION= 3.56 +CATEGORIES= net +MASTER_SITES= http://www.inlab.de/ + +MAINTAINER= portmaster@BSDforge.com +COMMENT= Simple but powerful generic TCP proxy with round robin features + +LICENSE= GPLv2 + +ALL_TARGET= balance +USE_RC_SUBR= balance + +pre-build: + @${REINPLACE_CMD} -e 's|^CFLAGS|CFLAGS?|' \ + -e 's|^CC|CC?|' ${WRKSRC}/Makefile + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/balance ${STAGEDIR}${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/balance.1 ${STAGEDIR}${MANPREFIX}/man/man1 + +.include <bsd.port.mk> diff --git a/net/balance/distinfo b/net/balance/distinfo new file mode 100644 index 000000000000..d3ccb8a7da37 --- /dev/null +++ b/net/balance/distinfo @@ -0,0 +1,2 @@ +SHA256 (balance-3.56.tar.gz) = 939a04eb5c89bd1a6b309a30507e36758dd9f1e90c76ed457c2c67b651dde89c +SIZE (balance-3.56.tar.gz) = 35477 diff --git a/net/balance/files/balance.in b/net/balance/files/balance.in new file mode 100644 index 000000000000..977bbfc323aa --- /dev/null +++ b/net/balance/files/balance.in @@ -0,0 +1,96 @@ +#!/bin/sh +# +# $FreeBSD: head/net/balance/files/balance.in 340872 2014-01-24 00:14:07Z mat $ +# + +# PROVIDE: balance +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# +# Add the following lines to /etc/rc.conf to enable balance: +# +#balance_enable="YES" +#balance_hosts="host1" +#balance_host1_flags="-a" +#balance_host1_address="host1.external.example" +#balance_host1_ports="http 8180" +#balance_host1_targets="host1.internal.example" +# +# See balance(8) for flags +# + +. /etc/rc.subr + +name=balance +rcvar=balance_enable +command=%%PREFIX%%/bin/balance + +start_cmd=start_cmd +stop_cmd=stop_cmd +status_cmd=status_cmd + +start_cmd() +{ + if [ -x "${command}" ]; then + for host in ${balance_hosts}; do + eval ports=\"\${balance_${host}_ports}\" + eval flags=\"\${balance_${host}_flags}\" + eval address=\"\${balance_${host}_address}\" + eval targets=\"\${balance_${host}_targets}\" + if [ "" != "${address}" ]; then + flags="${flags} -b ${address}" + fi + for port in ${ports}; do + "${command}" ${flags} ${port} ${targets} + done + done + fi +} + +stop_cmd() +{ + if [ -x "${command}" ]; then + for host in ${balance_hosts}; do + eval ports=\"\${balance_${host}_ports}\" + eval address=\"\${balance_${host}_address}\" + flags="" + if [ "" != "${address}" ]; then + flags="-b ${address}" + else + address='*' + fi + for port in ${ports}; do + echo "balance at ${address}:${port}" + "${command}" ${flags} -c kill ${port} + done + done + fi +} + +status_cmd() +{ + if [ -x "${command}" ]; then + for host in ${balance_hosts}; do + eval ports=\"\${balance_${host}_ports}\" + eval address=\"\${balance_${host}_address}\" + flags="" + if [ "" != "${address}" ]; then + flags="-b ${address}" + else + address='*' + fi + for port in ${ports}; do + echo "balance at ${address}:${port}" + "${command}" ${flags} -c show ${port} + done + done + fi +} + +# set defaults + +balance_enable=${balance_enable:-"NO"} + +load_rc_config $name +run_rc_command "$1" diff --git a/net/balance/pkg-descr b/net/balance/pkg-descr new file mode 100644 index 000000000000..2d0d1fab3b65 --- /dev/null +++ b/net/balance/pkg-descr @@ -0,0 +1,9 @@ +Balance is a simple but powerful generic tcp proxy with round robin load +balancing and failover mechanisms. Its behaviour can be controlled at runtime +using a simple command line syntax. + +The latest release now supports the definition of channel groups, connection +counting, and handling. Boosting the power, and versatility of balance, one +big step further. + +WWW: http://www.inlab.de/balance.html diff --git a/net/balance/pkg-plist b/net/balance/pkg-plist new file mode 100644 index 000000000000..41533736cd21 --- /dev/null +++ b/net/balance/pkg-plist @@ -0,0 +1,2 @@ +bin/balance +man/man1/balance.1.gz |