From 41ce9b724cc2749e2974eb08e848536ec11e5b42 Mon Sep 17 00:00:00 2001 From: Martin Bacovsky Date: Thu, 19 Jul 2007 20:42:07 +0000 Subject: [PATCH] - update to latest upstream 2.6.STABLE14 - resolves: #247064: Initscript Review --- .cvsignore | 2 +- sources | 2 +- ...g.patch => squid-2.6.STABLE14-config.patch | 31 +++++++-------- squid.init | 39 +++++++++++-------- squid.spec | 8 +++- 5 files changed, 46 insertions(+), 36 deletions(-) rename squid-2.5.STABLE11-config.patch => squid-2.6.STABLE14-config.patch (85%) diff --git a/.cvsignore b/.cvsignore index de90742..e985543 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -squid-2.6.STABLE12.tar.bz2 +squid-2.6.STABLE14.tar.bz2 diff --git a/sources b/sources index 90b7e75..0e87e03 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -a830ccc95cb39cdfa5e5b773add0bb0d squid-2.6.STABLE12.tar.bz2 +eadb138d48320df8b99349121159c6bf squid-2.6.STABLE14.tar.bz2 diff --git a/squid-2.5.STABLE11-config.patch b/squid-2.6.STABLE14-config.patch similarity index 85% rename from squid-2.5.STABLE11-config.patch rename to squid-2.6.STABLE14-config.patch index a9ec590..7b003af 100644 --- a/squid-2.5.STABLE11-config.patch +++ b/squid-2.6.STABLE14-config.patch @@ -1,6 +1,6 @@ ---- squid-2.5.STABLE11/src/cf.data.pre.config 2005-09-13 15:44:35.000000000 +0200 -+++ squid-2.5.STABLE11/src/cf.data.pre 2005-09-23 11:13:06.000000000 +0200 -@@ -2210,6 +2210,7 @@ +--- squid-2.6.STABLE14/src/cf.data.pre.config 2007-06-26 01:34:57.000000000 +0200 ++++ squid-2.6.STABLE14/src/cf.data.pre 2007-07-19 21:22:45.000000000 +0200 +@@ -2961,6 +2961,7 @@ #http_access allow our_networks # And finally deny all other access to this proxy @@ -8,7 +8,7 @@ http_access deny all NOCOMMENT_END DOC_END -@@ -2436,11 +2437,11 @@ +@@ -3243,11 +3244,11 @@ NAME: cache_mgr TYPE: string @@ -21,8 +21,8 @@ + mail if the cache dies. The default is "root". DOC_END - -@@ -2471,22 +2472,23 @@ + NAME: mail_from +@@ -3275,21 +3276,22 @@ NAME: cache_effective_user TYPE: string @@ -33,7 +33,7 @@ If you start Squid as root, it will change its effective/real UID/GID to the user specified below. The default is to change - to UID to nobody. If you define cache_effective_user, but not -+ to UID to "squid". If you define cache_effective_user, but not ++ to UID to squid. If you define cache_effective_user, but not cache_effective_group, Squid sets the GID to the effective user's default group ID (taken from the password file) and supplementary group list from the from groups membership of @@ -41,23 +41,22 @@ +cache_effective_user squid DOC_END - NAME: cache_effective_group TYPE: string -DEFAULT: none -+DEFAULT: squid ++DEFAULT: squid LOC: Config.effectiveGroup DOC_START If you want Squid to run with a specific GID regardless of -@@ -2496,6 +2498,7 @@ +@@ -3299,6 +3301,7 @@ and only this GID is effective. If Squid is not started as root the user starting Squid must be member of the specified group. +cache_effective_group squid DOC_END - -@@ -2723,7 +2726,7 @@ + NAME: httpd_suppress_version_string +@@ -3929,7 +3932,7 @@ NAME: logfile_rotate TYPE: int @@ -66,7 +65,7 @@ LOC: Config.Log.rotateNumber DOC_START Specifies the number of logfile rotations to make when you -@@ -2739,6 +2742,8 @@ +@@ -3945,6 +3948,8 @@ purposes, so -k rotate uses another signal. It is best to get in the habit of using 'squid -k rotate' instead of 'kill -USR1 '. @@ -74,8 +73,8 @@ +logfile_rotate 0 DOC_END - -@@ -3296,10 +3301,18 @@ + NAME: append_domain +@@ -4546,10 +4551,18 @@ LOC: Config.errorDirectory DEFAULT: @DEFAULT_ERROR_DIR@ DOC_START @@ -97,7 +96,7 @@ DOC_END NAME: maximum_single_addr_tries -@@ -3333,12 +3346,12 @@ +@@ -4583,12 +4596,12 @@ NAME: snmp_port TYPE: ushort LOC: Config.Port.snmp diff --git a/squid.init b/squid.init index a3e03c3..a71e3b1 100644 --- a/squid.init +++ b/squid.init @@ -1,16 +1,18 @@ #!/bin/bash -# squid This shell script takes care of starting and stopping -# Squid Internet Object Cache -# +### BEGIN INIT INFO +# Provides: squid # chkconfig: - 90 25 -# description: Squid - Internet Object Cache. Internet object caching is \ +# pidfile: /var/run/squid.pid +# config: /etc/squid/squid.conf +# Short-Description: starting and stopping Squid Internet Object Cache +# Description: Squid - Internet Object Cache. Internet object caching is \ # a way to store requested Internet objects (i.e., data available \ # via the HTTP, FTP, and gopher protocols) on a system closer to the \ # requesting site than to the source. Web browsers can then use the \ # local Squid cache as a proxy HTTP server, reducing access time as \ # well as bandwidth consumption. -# pidfile: /var/run/squid.pid -# config: /etc/squid/squid.conf +### END INIT INFO + PATH=/usr/bin:/sbin:/bin:/usr/sbin export PATH @@ -21,12 +23,6 @@ export PATH # Source networking configuration. . /etc/sysconfig/network -# Check that networking is up. -[ ${NETWORKING} = "no" ] && exit 0 - -# check if the squid conf file is present -[ -f /etc/squid/squid.conf ] || exit 0 - if [ -f /etc/sysconfig/squid ]; then . /etc/sysconfig/squid fi @@ -39,7 +35,18 @@ SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100} # determine the name of the squid binary [ -f /usr/sbin/squid ] && SQUID=squid -[ -z "$SQUID" ] && exit 0 + +if [ $1 -ne 'status' ]; then + [ -z "$SQUID" ] && exit 1 + + # Check that networking is up. + [ ${NETWORKING} = "no" ] && exit 1 + + # check if the squid conf file is present + [ -f /etc/squid/squid.conf ] || exit 6 +else + [ -z "$SQUID" ] && exit 4 +fi prog="$SQUID" @@ -152,12 +159,12 @@ status) ;; probe) - exit 0 + probe ;; *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" - exit 1 + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart|probe}" + exit 2 esac exit $? diff --git a/squid.spec b/squid.spec index d01e301..a14440c 100644 --- a/squid.spec +++ b/squid.spec @@ -4,7 +4,7 @@ Summary: The Squid proxy caching server Name: squid -Version: 2.6.STABLE12 +Version: 2.6.STABLE14 Release: 1%{?dist} Epoch: 7 License: GPL @@ -26,7 +26,7 @@ Source98: perl-requires-squid.sh # Local patches # Applying upstream patches first makes it less likely that local patches # will break upstream ones. -Patch201: squid-2.5.STABLE11-config.patch +Patch201: squid-2.6.STABLE14-config.patch Patch202: squid-2.5.STABLE4-location.patch Patch203: squid-2.6.STABLE2-build.patch Patch204: squid-2.5.STABLE4-perlpath.patch @@ -326,6 +326,10 @@ fi chgrp squid /var/cache/samba/winbindd_privileged >/dev/null 2>&1 || : %changelog +* Thu Jul 19 2007 Martin Bacovsky - 7:2.6.STABLE14-1 +- update to latest upstream 2.6.STABLE14 +- resolves: #247064: Initscript Review + * Tue Mar 27 2007 Martin Bacovsky - 7:2.6.STABLE12-1 - update to latest upstream 2.6.STABLE12 - Resolves: #233913: squid: unowned directory