From owner-freebsd-ports-bugs@FreeBSD.ORG Sun Nov 1 15:40:05 2009 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE87C106566B for ; Sun, 1 Nov 2009 15:40:05 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9C9C18FC1B for ; Sun, 1 Nov 2009 15:40:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id nA1Fe5ZX085588 for ; Sun, 1 Nov 2009 15:40:05 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nA1Fe5qR085587; Sun, 1 Nov 2009 15:40:05 GMT (envelope-from gnats) Date: Sun, 1 Nov 2009 15:40:05 GMT Message-Id: <200911011540.nA1Fe5qR085587@freefall.freebsd.org> To: freebsd-ports-bugs@FreeBSD.org From: Thomas-Martin Seck Cc: Subject: Re: ports/140146: [patch] www/squid: Add squid_fib option for alternate routing tables X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Thomas-Martin Seck List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Nov 2009 15:40:05 -0000 The following reply was made to PR ports/140146; it has been noted by GNATS. From: Thomas-Martin Seck To: bug-followup@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%%}