ports/137335: net/balance rc.d script should not force binding to a single interface

Hans Hoppe hopha at cinis.com
Sat Aug 1 15:50:02 UTC 2009


>Number:         137335
>Category:       ports
>Synopsis:       net/balance rc.d script should not force binding to a single interface
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 01 15:50:01 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Hans Hoppe
>Release:        RELENG_7; ports-all tag=.
>Organization:
>Environment:
n.a.
>Description:
The net/balance rc.d script has the -b flag to balance hardcoded. This forces balance to bind to a single interface. Use of balance_*_address and the -b flag should be optional.
>How-To-Repeat:

>Fix:
The attached patch for balance.sh.in makes using balance_*_address optional.

Patch attached with submission follows:

--- balance.sh.in.orig	2008-11-01 13:34:48.000000000 +0100
+++ balance.sh.in	2009-08-01 16:43:59.000000000 +0200
@@ -38,8 +38,11 @@
 			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} -b ${address} ${port} ${targets}
+				"${command}" ${flags} ${port} ${targets}
 			done
 		done
 	fi
@@ -51,9 +54,15 @@
 		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}" -b ${address} -c kill ${port}
+				"${command}" ${flags} -c kill ${port}
 			done
 		done
 	fi
@@ -65,9 +74,15 @@
 		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}" -b ${address} -c show ${port}
+				"${command}" ${flags} -c show ${port}
 			done
 		done
 	fi


>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list