From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Sep 1 18:20:26 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F2E9C16A4CE for ; Wed, 1 Sep 2004 18:20:25 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id ADDB743D68 for ; Wed, 1 Sep 2004 18:20:25 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i81IKPw0086687 for ; Wed, 1 Sep 2004 18:20:25 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i81IKP1O086686; Wed, 1 Sep 2004 18:20:25 GMT (envelope-from gnats) Resent-Date: Wed, 1 Sep 2004 18:20:25 GMT Resent-Message-Id: <200409011820.i81IKP1O086686@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Thomas-Martin Seck Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2E21F16A4CE for ; Wed, 1 Sep 2004 18:19:27 +0000 (GMT) Received: from smtp2.netcologne.de (smtp2.netcologne.de [194.8.194.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80F3143D5D for ; Wed, 1 Sep 2004 18:19:26 +0000 (GMT) (envelope-from tmseck@netcologne.de) Received: from laurel.tmseck.homedns.org (xdsl-81-173-231-176.netcologne.de [81.173.231.176]) by smtp2.netcologne.de (Postfix) with SMTP id 0FE254324 for ; Wed, 1 Sep 2004 20:19:24 +0200 (MEST) Received: (qmail 3195 invoked by uid 1001); 1 Sep 2004 18:19:45 -0000 Message-Id: <20040901181945.3194.qmail@laurel.tmseck.homedns.org> Date: 1 Sep 2004 18:19:45 -0000 From: Thomas-Martin Seck To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/71260: [Maintainer] www/squid: new vendor patches, tunable rcNG'fication X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 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: Wed, 01 Sep 2004 18:20:26 -0000 >Number: 71260 >Category: ports >Synopsis: [Maintainer] www/squid: new vendor patches, tunable rcNG'fication >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Wed Sep 01 18:20:25 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Thomas-Martin Seck >Release: FreeBSD 4.10-STABLE i386 >Organization: a private site in Germany >Environment: FreeBSD ports collection as of September 1st, 2004. >Description: Implement vendor patches for the following issues: - try to prevent crashes of the digest helper (squid bug #1031) - correct parsing of the acl_time directive when multiple time specifications are given (squid bug #1060) - correct "cachemgr config" output for http_header_* directives (squid bug #1056) - recognize the Content-Disposition header to be able to specify http_header_access directives using it (squid bug #961) See for further information. Reimplement the rcNG support: - Implement a new option "WITH_SQUID_RCNG" which defaults to on, so squid will now install an rcNG script by default even on 4.x systems. If WITHOUT_SQUID_RCNG is defined or the respective option is unset using "make config", an "rcOld only" script will be installed instead. The rcNG version of squid.sh does not fall back to rcOld anymore. Note to committer: see below for a proposed /usr/ports/UPDATING entry. - Take into account that the squid master process waits up to shutdown_lifetime seconds before it shuts down its child and itself. The restart_command thus needs to wait for this actual shutdown to happen after the stop_command has been sent before the start_command may be issued (thanks to FUJISHIMA Satsuki for pointing this out and providing a patch). Remove updating notes from pkg-descr and pkg-install that should have served their purpose by now and remove a superflous newline in pkg-descr while at it. Proposed /usr/ports/UPDATING entry: 20040901: AFFECTS: users of www/squid AUTHOR: tmseck@netcologne.de www/squid now installs an rcNG script by default. This means you need to explicitly enable squid by setting squid_enable=yes in /etc/rc.conf. The squid.sh script uses the following variables: squid_chdir squid_flags squid_user Please see the squid.sh script for further details. If you want to install an old style rc-script, build the port with "WITHOUT_SQUID_RCNG=YES" or by rerunning "make config" and disabling this option. >How-To-Repeat: >Fix: Apply this patch: Index: pkg-descr =================================================================== --- pkg-descr (.../www/squid) (revision 219) +++ pkg-descr (.../local/squid) (revision 219) @@ -11,13 +11,5 @@ Please see this port's Makefile for a list of compilation options. -*** UPDATE NOTICE *** -Starting from Version 2.5.4_6 the default user:group changed from -nobody:nogroup to squid:squid. You can restore the old behavior -of this port by specifying SQUID_UID=nobody SQUID_GID=nogroup in -your make environment. Helper applications are now installed to -$PREFIX/libexec/squid instead of $PREFIX/libexec, too. - You can find further information on the project's website at - WWW: http://www.squid-cache.org/ Index: distinfo =================================================================== --- distinfo (.../www/squid) (revision 219) +++ distinfo (.../local/squid) (revision 219) @@ -40,3 +40,11 @@ SIZE (squid2.5/squid-2.5.STABLE6-ntlm_challengereuse_leak.patch) = 13473 MD5 (squid2.5/squid-2.5.STABLE6-rotate_error.patch) = e842e11bd987d56e49df020a17fb1ad9 SIZE (squid2.5/squid-2.5.STABLE6-rotate_error.patch) = 2238 +MD5 (squid2.5/squid-2.5.STABLE6-digest_crash.patch) = b0e5a15164ac7f14682bc200f2efd6c9 +SIZE (squid2.5/squid-2.5.STABLE6-digest_crash.patch) = 1250 +MD5 (squid2.5/squid-2.5.STABLE6-acl_times.patch) = 91c69f9a5cebd5d84a4eee63ea10be99 +SIZE (squid2.5/squid-2.5.STABLE6-acl_times.patch) = 3047 +MD5 (squid2.5/squid-2.5.STABLE6-http_header_range.patch) = 83b25961601597375682afde86ce23a8 +SIZE (squid2.5/squid-2.5.STABLE6-http_header_range.patch) = 616 +MD5 (squid2.5/squid-2.5.STABLE6-Content-Disposition.patch) = c11ca0bcf406b4240a745fc52b063495 +SIZE (squid2.5/squid-2.5.STABLE6-Content-Disposition.patch) = 1815 Index: files/squid.sh =================================================================== --- files/squid.sh (.../www/squid) (revision 219) +++ files/squid.sh (.../local/squid) (revision 219) @@ -2,23 +2,28 @@ # # $FreeBSD: ports/www/squid/files/squid.sh,v 1.7 2004/07/25 16:30:43 pav Exp $ # +# --begin rcng # PROVIDE: squid # REQUIRE: NETWORKING SERVERS # BEFORE: DAEMON # KEYWORD: FreeBSD shutdown # # Note: -# If you are running an rcNG-System (i.e. FreeBSD 5 and later) you need to set -# "squid_enable=YES" in either /etc/rc.conf, /etc/rc.conf.local or +# Set "squid_enable=yes" in either /etc/rc.conf, /etc/rc.conf.local or # /etc/rc.conf.d/squid to make this script actually do something. There # you can also set squid_chdir, squid_user, and squid_flags. # # Please see squid(8), rc.conf(5) and rc(8) for further details. +# +# --end rcng -name="squid" +name=squid command=%%PREFIX%%/sbin/squid +# --begin rcng extra_commands=reload reload_cmd="${command} -k reconfigure" +restart_cmd=squid_restart +# --end rcng stop_cmd="${command} -k shutdown" squid_chdir=${squid_chdir:-%%PREFIX%%/squid/logs} squid_enable=${squid_enable:-"NO"} @@ -26,45 +31,52 @@ squid_user=${squid_user:-%%SQUID_UID%%} default_config=%%PREFIX%%/etc/squid/squid.conf -if [ -f /etc/rc.subr ]; then - # make use of rcNG features: - . /etc/rc.subr - rcvar=`set_rcvar` - load_rc_config ${name} - # squid(8) will not start if ${default_config} is not present so try - # to catch that beforehand via ${required_files} rather than make - # squid(8) crash. - # If you remove the default configuration file make sure to add - # '-f /path/to/your/squid.conf' to squid_flags - if [ -z "${squid_flags}" ]; then - required_files=${default_config} +# --begin rcng +squid_restart() { + run_rc_command stop + run_rc_command poll + run_rc_command start +} + +. %%RC_SUBR%% +rcvar=`set_rcvar` +load_rc_config ${name} + +# squid(8) will not start if ${default_config} is not present so try +# to catch that beforehand via ${required_files} rather than make +# squid(8) crash. +# If you remove the default configuration file make sure to add +# '-f /path/to/your/squid.conf' to squid_flags + +if [ -z "${squid_flags}" ]; then + required_files=${default_config} +fi +required_dirs=${squid_chdir} +run_rc_command "$1" +# --end rcng +# --begin rcold +case $1 in +start) + if [ -x "${command}" -a \ + \( -f "${default_config}" -o "${squid_flags}" \) ]; then + echo -n " ${name}" + (cd ${squid_chdir} && exec su -fm ${squid_user} -c \ + "${command} ${squid_flags}") fi - required_dirs=${squid_chdir} - run_rc_command "$1" -else - # implement the startup using the "old style" for non-rcNG-systems: - case $1 in - start) - if [ -x "${command}" -a \ - \( -f "${default_config}" -o "${squid_flags}" \) ]; then - echo -n ' squid' - (cd ${squid_chdir} && exec su -fm ${squid_user} -c \ - "${command} ${squid_flags}") - fi - ;; - stop) - if [ -x "${command}" ]; then - echo -n ' squid' - ${stop_cmd} - while ps -xcU ${squid_user} | grep -q squid; do - sleep 2 - done - fi - ;; - *) - echo "usage: ${0##*/} {start|stop}" >&2 - exit 64 - ;; - esac - exit 0 -fi + ;; +stop) + if [ -x "${command}" ]; then + echo -n " ${name}" + ${stop_cmd} + while ps -xcU ${squid_user} | grep -q squid; do + sleep 2 + done + fi + ;; + *) + echo "usage: ${0##*/} {start|stop}" >&2 + exit 64 + ;; +esac +exit 0 +# --end rcold Index: pkg-install =================================================================== --- pkg-install (.../www/squid) (revision 219) +++ pkg-install (.../local/squid) (revision 219) @@ -146,24 +146,16 @@ echo " initialize the cache directory by running \"squid -z\"" echo " as 'root' or '${squid_user}' before starting squid." echo "" - tput md - echo " *** UPDATE NOTICE ***" + echo " Please note that ${PKG_PREFIX}/etc/rc.d/squid.sh" + echo " will not start squid automatically anymore unless you" + echo " explicitly configured the port not to install an rcNG" + echo " style startup script via 'make config'." echo "" - echo " Starting with version 2.5.4_6, all helper applications are" - echo " installed to ${PKG_PREFIX}/libexec/squid instead of" - echo " ${PKG_PREFIX}/libexec." - echo " Please check your squid.conf and update it if necessary." - tput me + echo " To enable squid, set squid_enable=yes in either" + echo " /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid" + echo " See ${PKG_PREFIX}/etc/rc.d/squid.sh for more" + echo " configuration options." echo "" - if [ -f /etc/rc.subr ]; then - echo " Please note that ${PKG_PREFIX}/etc/rc.d/squid.sh" - echo " will not start squid automatically on this system." - echo " You need to set squid_enable=yes in either" - echo " /etc/rc.conf, /etc/rc.conf.local or /etc/rc.conf.d/squid" - echo " See ${PKG_PREFIX}/etc/rc.d/squid.sh for more" - echo " configuration options." - echo "" - fi ;; *) exit 64 Index: Makefile =================================================================== --- Makefile (.../www/squid) (revision 219) +++ Makefile (.../local/squid) (revision 219) @@ -74,7 +74,7 @@ PORTNAME= squid PORTVERSION= 2.5.6 -PORTREVISION= 9 +PORTREVISION= 10 CATEGORIES= www MASTER_SITES= \ ftp://ftp.squid-cache.org/pub/%SUBDIR%/ \ @@ -106,7 +106,11 @@ squid-2.5.STABLE6-ntlm_fetch_string.patch \ squid-2.5.STABLE6-ntlm_noreuse_leak.patch \ squid-2.5.STABLE6-ntlm_challengereuse_leak.patch \ - squid-2.5.STABLE6-rotate_error.patch + squid-2.5.STABLE6-rotate_error.patch \ + squid-2.5.STABLE6-digest_crash.patch \ + squid-2.5.STABLE6-acl_times.patch \ + squid-2.5.STABLE6-http_header_range.patch \ + squid-2.5.STABLE6-Content-Disposition.patch PATCH_DIST_STRIP= -p1 MAINTAINER= tmseck@netcologne.de @@ -148,7 +152,8 @@ SQUID_FOLLOW_XFF "Follow X-Forwarded-For headers" off \ SQUID_AUFS "Enable the aufs storage scheme" off \ SQUID_COSS "Enable the COSS storage scheme" off \ - SQUID_STACKTRACES "Create backtraces on fatal errors" off + SQUID_STACKTRACES "Create backtraces on fatal errors" off \ + SQUID_RCNG "Install an rcNG startup script" on PLIST_FILES= etc/rc.d/squid.sh etc/squid/mib.txt etc/squid/mime.conf.default \ etc/squid/msntauth.conf.default etc/squid/squid.conf.default \ @@ -298,6 +303,14 @@ .if defined(WITH_SQUID_STACKTRACES) CONFIGURE_ARGS+= --enable-stacktraces .endif +.if !defined(WITHOUT_SQUID_RCNG) +USE_RC_SUBR= yes +rc_del= rcold +rc_state= rcng +.else +rc_del= rcng +rc_state= rcold +.endif # Languages: # @@ -338,8 +351,12 @@ # Prevent installation of .orig files by deleting them. @${FIND} ${WRKSRC} -name '*.bak' -delete @${FIND} ${WRKSRC} -name '*.orig' -delete +# create an rcOld/rcNG squid.sh: @${SED} -e 's|%%PREFIX%%|${PREFIX}|g' \ - -e 's|%%SQUID_UID%%|${SQUID_UID}|g' ${FILESDIR}/squid.sh \ + -e 's|%%SQUID_UID%%|${SQUID_UID}|g' \ + -e 's|%%RC_SUBR%%|${RC_SUBR}|g' \ + -e '/--begin ${rc_del}/,/--end ${rc_del}/d' \ + -e '/--.*${rc_state}/d' ${FILESDIR}/squid.sh \ >${WRKDIR}/squid.sh pre-su-install: >Release-Note: >Audit-Trail: >Unformatted: