ports/71260: [Maintainer] www/squid: new vendor patches, tunable rcNG'fication

Thomas-Martin Seck tmseck at netcologne.de
Wed Sep 1 18:20:26 UTC 2004


>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 <http://www.squid-cache.org/Versions/v2/2.5/bugs/> 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 <sf at freebsd.org> 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 at 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 at 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:



More information about the freebsd-ports-bugs mailing list