Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 31 Oct 2009 17:59:22 +0100 (CET)
From:      Alson van der Meulen <alson+bugs@waalsdorp.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/140146: [patch] www/squid: Add squid_fib option for alternate routing tables
Message-ID:  <20091031165922.97AC4B900@eraser.waalsdorp.nl>
Resent-Message-ID: <200910311700.n9VH0BIl077716@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20091031165922.97AC4B900>