ports/140146: [patch] www/squid: Add squid_fib option for alternate routing tables

Alson van der Meulen alson+bugs at waalsdorp.nl
Sat Oct 31 17:00:15 UTC 2009


>Number:         140146
>Category:       ports
>Synopsis:       [patch] www/squid: Add squid_fib option for alternate routing tables
>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 Oct 31 17:00:10 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Alson van der Meulen
>Release:        FreeBSD 7.2-RELEASE-p4 i386
>Organization:
>Environment:
System: FreeBSD eraser.waalsdorp.nl 7.2-RELEASE-p4 FreeBSD 7.2-RELEASE-p4 #0: Sat Oct 24 12:13:11 CEST 2009 root at eraser.waalsdorp.nl:/usr/obj/usr/src/sys/ERASER2 i386

squid-2.7.7

>Description:
It would be nice if rc.subr would get generic setfib(1) support someday,
but www/apache22 also contains specific setfib support, so that seems to
be the way to go for now. This patch adds the squid_fib rc.conf option,
which can be used to run squid with an alternate route table.

This patch was based on the changes in apache22-2.2.9_2, and is lightly
tested (start/stop works both with and without squid_fib set, and it
actually uses the alternate fib).

>How-To-Repeat:
	
>Fix:

--- squid.in.orig	2007-08-14 04:32:11.000000000 +0200
+++ squid.in	2009-10-31 17:17:37.000000000 +0100
@@ -18,6 +18,18 @@
 	${command} ${squid_flags} -k check 2>/dev/null
 }
 
+squid_checkfib() {
+	sysctl net.fibs 2>&1 > /dev/null
+	ret=$? 
+	[ $ret -gt 0 ] && return 0 
+	if [ "x$squid_fib" != "xNO" ]
+	then 
+		command="setfib -F ${squid_fib} ${command}"
+	else
+		return  0
+	fi
+}
+
 squid_stop() {
 	echo "Stopping ${name}."
 	${command} ${squid_flags} -k shutdown
@@ -34,6 +46,7 @@
 reload_cmd="${command} ${squid_flags} -k reconfigure"
 stop_precmd="squid_checkrunning"
 stop_cmd="squid_stop"
+start_precmd="squid_checkfib"
 
 load_rc_config ${name}
 
@@ -42,6 +55,7 @@
 squid_flags=${squid_flags-"-D"}
 squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"}
 squid_user=${squid_user:-%%SQUID_UID%%}
+squid_fib=${squid_fib:-NO}
 default_config=%%PREFIX%%/etc/squid/squid.conf
 
 pidfile=${squid_pidfile}
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list