Bug 11815 - Small fix for squid startup script.
Summary: Small fix for squid startup script.
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: squid   
(Show other bugs)
Version: 6.2
Hardware: i386 Linux
low
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-06-01 06:25 UTC by Andy Jones
Modified: 2014-03-17 02:14 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-06-01 06:25:04 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Andy Jones 2000-06-01 06:25:03 UTC
In /etc/rc.d/init.d/squid, lines 34-38 say

# determine which one is the cache_swap directory
CACHE_SWAP=`sed -e ''s/#.*//g'' /etc/squid/squid.conf | '\
        grep cache_dir | sed -e ''s/cache_dir//'' | '\
        cut -d '' '' -f 2`
[ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid


By default, the grep fails because the cache dir line in the
/etc/squid/squid.conf  file is commented out.   Namely:

#cache_dir ufs /var/spool/squid 100 16 256

If a  cache_dir  line is added which contains extra blank space around the
"ufs" or directory field, then the   cut  will select the blank space and
so CACHE_SWAP will be empty and then erroneously re-set to 
/var/spool/squid.

(I know because this happened to me)

My suggestion is to change the  cut  command to   awk ''{ print $2 }''
which unlike cut is tolerant of multiple blank spaces.  

/'\ndy

Comment 1 Bill Nottingham 2000-06-10 22:59:56 UTC
This should already be fixed in the squid package currently in rawhide.


Note You need to log in before you can comment on or make changes to this bug.