diff --git a/.cvsignore b/.cvsignore index e58682f..448c0f9 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -squid-3.0.STABLE1.tar.bz2 +squid-3.0.STABLE2.tar.bz2 diff --git a/sources b/sources index f8d65b0..5c18b87 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -ec7458b00a68341854d91e7f6ece56ba squid-3.0.STABLE1.tar.bz2 +33c89b22aaf27d12b818b5f120aa0322 squid-3.0.STABLE2.tar.bz2 diff --git a/squid-3.0.STABLE1-location.patch b/squid-3.0.STABLE1-location.patch index 1b576bd..34ab3ff 100644 --- a/squid-3.0.STABLE1-location.patch +++ b/squid-3.0.STABLE1-location.patch @@ -1,6 +1,6 @@ -diff -up squid-3.0.STABLE1/QUICKSTART.location squid-3.0.STABLE1/QUICKSTART ---- squid-3.0.STABLE1/QUICKSTART.location 2003-07-18 13:10:32.000000000 +0200 -+++ squid-3.0.STABLE1/QUICKSTART 2008-01-23 12:07:50.000000000 +0100 +diff -up squid-3.0.STABLE2/QUICKSTART.location squid-3.0.STABLE2/QUICKSTART +--- squid-3.0.STABLE2/QUICKSTART.location 2008-02-10 12:04:32.000000000 +0100 ++++ squid-3.0.STABLE2/QUICKSTART 2008-03-11 15:53:36.000000000 +0100 @@ -12,10 +12,9 @@ After you retrieved, compiled and instal INSTALL in the same directory), you have to configure the squid.conf file. This is the list of the values you *need* to change, because no @@ -18,12 +18,12 @@ diff -up squid-3.0.STABLE1/QUICKSTART.location squid-3.0.STABLE1/QUICKSTART always ask permission before adding a parent cache. See also the never_direct/always_direct directives. --cache_dir /usr/local/squid/var/cache 100 16 256 -+cache_dir /var/spool/squid 100 16 256 +-cache_dir ufs /usr/local/squid/var/cache 100 16 256 ++cache_dir ufs /var/spool/squid 100 16 256 Add here (first number, here 100) the amount of hard disk space (in megabytes) to devote to caching. -@@ -69,8 +68,8 @@ visible_hostname +@@ -69,10 +68,10 @@ visible_hostname After editing squid.conf to your liking, run Squid from the command line TWICE: @@ -32,5 +32,8 @@ diff -up squid-3.0.STABLE1/QUICKSTART.location squid-3.0.STABLE1/QUICKSTART + % /usr/sbin/squid -z + % /usr/sbin/squid - Check in the cache.log (/usr/local/squid/var/logs/cache.log) that +-Check in the cache.log (/usr/local/squid/var/logs/cache.log) that ++Check in the cache.log (/var/log/squid/cache.log) that everything is all right. + + Once Squid created all its files (it can take several minutes on some diff --git a/squid.init b/squid.init index d093a02..b8f4a17 100644 --- a/squid.init +++ b/squid.init @@ -6,11 +6,11 @@ # 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. +# 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. ### END INIT INFO @@ -24,10 +24,10 @@ export PATH . /etc/sysconfig/network if [ -f /etc/sysconfig/squid ]; then - . /etc/sysconfig/squid + . /etc/sysconfig/squid fi -# don't raise an error if the config file is incomplete +# don't raise an error if the config file is incomplete # set defaults instead: SQUID_OPTS=${SQUID_OPTS:-"-D"} SQUID_PIDFILE_TIMEOUT=${SQUID_PIDFILE_TIMEOUT:-20} @@ -38,7 +38,7 @@ SQUID_SHUTDOWN_TIMEOUT=${SQUID_SHUTDOWN_TIMEOUT:-100} if [ "$1" == "status" ]; then [ -z "$SQUID" ] && exit 4 -else +else [ -z "$SQUID" ] && exit 1 fi @@ -46,7 +46,7 @@ prog="$SQUID" # determine which one is the cache_swap directory CACHE_SWAP=`sed -e 's/#.*//g' /etc/squid/squid.conf | \ - grep cache_dir | awk '{ print $3 }'` + grep cache_dir | awk '{ print $3 }'` [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid RETVAL=0 @@ -57,116 +57,124 @@ probe() { # check if the squid conf file is present [ -f /etc/squid/squid.conf ] || exit 6 -} +} start() { probe - for adir in $CACHE_SWAP; do - if [ ! -d $adir/00 ]; then - echo -n "init_cache_dir $adir... " - $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1 + $SQUID -k parse + RETVAL=$? + if [ $RETVAL -ne 0 ]; then + echo -n $"Starting $prog: " + echo_failure + echo + return 1 + fi + for adir in $CACHE_SWAP; do + if [ ! -d $adir/00 ]; then + echo -n "init_cache_dir $adir... " + $SQUID -z -F -D >> /var/log/squid/squid.out 2>&1 fi - done - echo -n $"Starting $prog: " - $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1 - RETVAL=$? - if [ $RETVAL -eq 0 ]; then - timeout=0; - while : ; do - [ ! -f /var/run/squid.pid ] || break - if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then - RETVAL=1 - break - fi - sleep 1 && echo -n "." - timeout=$((timeout+1)) - done - fi - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID - [ $RETVAL -eq 0 ] && echo_success - [ $RETVAL -ne 0 ] && echo_failure - echo - return $RETVAL + done + echo -n $"Starting $prog: " + $SQUID $SQUID_OPTS >> /var/log/squid/squid.out 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ]; then + timeout=0; + while : ; do + [ ! -f /var/run/squid.pid ] || break + if [ $timeout -ge $SQUID_PIDFILE_TIMEOUT ]; then + RETVAL=1 + break + fi + sleep 1 && echo -n "." + timeout=$((timeout+1)) + done + fi + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$SQUID + [ $RETVAL -eq 0 ] && echo_success + [ $RETVAL -ne 0 ] && echo_failure + echo + return $RETVAL } stop() { - echo -n $"Stopping $prog: " - $SQUID -k check >> /var/log/squid/squid.out 2>&1 - RETVAL=$? - if [ $RETVAL -eq 0 ] ; then - $SQUID -k shutdown & - rm -f /var/lock/subsys/$SQUID - timeout=0 - while : ; do - [ -f /var/run/squid.pid ] || break - if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then - echo - return 1 - fi - sleep 2 && echo -n "." - timeout=$((timeout+2)) - done - echo_success - echo - else - echo_failure - echo - fi - return $RETVAL -} + echo -n $"Stopping $prog: " + $SQUID -k check >> /var/log/squid/squid.out 2>&1 + RETVAL=$? + if [ $RETVAL -eq 0 ] ; then + $SQUID -k shutdown & + rm -f /var/lock/subsys/$SQUID + timeout=0 + while : ; do + [ -f /var/run/squid.pid ] || break + if [ $timeout -ge $SQUID_SHUTDOWN_TIMEOUT ]; then + echo + return 1 + fi + sleep 2 && echo -n "." + timeout=$((timeout+2)) + done + echo_success + echo + else + echo_failure + echo + fi + return $RETVAL +} reload() { - $SQUID $SQUID_OPTS -k reconfigure + $SQUID $SQUID_OPTS -k reconfigure } restart() { - stop - start -} - -condrestart() { - [ -e /var/lock/subsys/squid ] && restart || : + stop + start } -rhstatus() { - status $SQUID && $SQUID -k check +condrestart() { + [ -e /var/lock/subsys/squid ] && restart || : +} + +rhstatus() { + status $SQUID && $SQUID -k check } case "$1" in start) - start - ;; + start + ;; stop) - stop - ;; + stop + ;; reload) - reload - ;; + reload + ;; restart) - restart - ;; + restart + ;; condrestart) - condrestart - ;; + condrestart + ;; status) - rhstatus - ;; + rhstatus + ;; probe) - probe - return 0 - ;; + probe + return 0 + ;; *) - echo $"Usage: $0 {start|stop|status|reload|restart|condrestart|probe}" - exit 2 + echo $"Usage: $0 {start|stop|status|reload|restart|condrestart|probe}" + exit 2 esac exit $? diff --git a/squid.spec b/squid.spec index e747d21..6bf790c 100644 --- a/squid.spec +++ b/squid.spec @@ -3,11 +3,11 @@ ## % define __find_requires %{SOURCE99} Name: squid -Version: 3.0.STABLE1 -Release: 3%{?dist} +Version: 3.0.STABLE2 +Release: 1%{?dist} Summary: The Squid proxy caching server Epoch: 7 -License: GPLv2 +License: GPLv2+ Group: System Environment/Daemons URL: http://www.squid-cache.org Source: http://www.squid-cache.org/Squid/Versions/v3/3.0/squid-%{version}.tar.bz2 @@ -32,7 +32,7 @@ Patch203: squid-3.0.STABLE1-build.patch Patch204: squid-3.0.STABLE1-perlpath.patch Patch205: squid-3.0.STABLE1-smb-path.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-root +Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Requires: bash >= 2.0 Requires(pre): shadow-utils Requires(post): /sbin/chkconfig @@ -97,9 +97,10 @@ export CXXFLAGS="-fPIE" ; export CFLAGS="-fPIE -Os -g -pipe -fsigned-char" ; exp --enable-wccpv2 \ --with-aio \ --with-default-user="squid" \ + --with-filedescriptors=16384 \ --with-dl \ --with-openssl=/usr/kerberos \ - --with-pthreads \ + --with-pthreads # following options are no longer supported # --with-winbind-auth-challenge \ @@ -330,6 +331,13 @@ fi chgrp squid /var/cache/samba/winbindd_privileged >/dev/null 2>&1 || : %changelog +* Tue Mar 13 2008 Martin Nagy - 7:3.0.STABLE2-1 +- upgrade to latest upstream 3.0.STABLE2 +- check config file before starting (#428998) +- whitespace unification of init script +- some minor path changes in the QUICKSTART file +- configure with the --with-filedescriptors=16384 option + * Tue Feb 26 2008 Martin Nagy - 7:3.0.STABLE1-3 - change the cache_effective_group default back to none