ports/140146: [patch] www/squid: Add squid_fib option for alternate routing tables
Thomas-Martin Seck
tmseck at web.de
Sun Nov 1 15:40:05 UTC 2009
The following reply was made to PR ports/140146; it has been noted by GNATS.
From: Thomas-Martin Seck <tmseck at web.de>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/140146: [patch] www/squid: Add squid_fib option for alternate routing tables
Date: Sun, 1 Nov 2009 16:18:23 +0100
Thanks for your submission! I made some stylistic changes and simplified
the test logic a bit.
Could you try this patch and make sure it still does what it should (on
my FreeBSD 4 test system it correctly skips setfib(1) -- and it should
do so on 6.x, too)?
Index: files/squid.in
===================================================================
--- files/squid.in (revision 1667)
+++ files/squid.in (working copy)
@@ -11,6 +11,9 @@
# /etc/rc.conf.d/squid to make this script actually do something. There
# you can also set squid_chdir, squid_pidfile, squid_user, and squid_flags.
#
+# On FreeBSD 7.1 and beyond you can use squid_fib to set a different routing
+# table for squid. See setfib(1) for details.
+#
# Please see squid(8), rc.conf(5) and rc(8) for further details.
#
@@ -18,6 +21,15 @@
${command} ${squid_flags} -k check 2>/dev/null
}
+squid_setfib() {
+ sysctl net.fibs >/dev/null 2>&1 || return 0
+ if [ "x${squid_fib}" != "xNONE" ]; then
+ command="setfib -F ${squid_fib} ${command}"
+ else
+ return 0
+ fi
+}
+
squid_stop() {
echo "Stopping ${name}."
${command} ${squid_flags} -k shutdown
@@ -32,6 +44,7 @@
command=%%PREFIX%%/sbin/squid
extra_commands=reload
reload_cmd="${command} ${squid_flags} -k reconfigure"
+start_precmd="squid_setfib"
stop_precmd="squid_checkrunning"
stop_cmd="squid_stop"
@@ -39,6 +52,7 @@
squid_chdir=${squid_chdir:-"%%PREFIX%%/squid/logs"}
squid_enable=${squid_enable:-"NO"}
+squid_fib=${squid_fib:-"NONE"}
squid_flags=${squid_flags-"-D"}
squid_pidfile=${squid_pidfile:-"%%PREFIX%%/squid/logs/squid.pid"}
squid_user=${squid_user:-%%SQUID_UID%%}
More information about the freebsd-ports-bugs
mailing list