Bug 126189 - Squid startup not setting permissions on cache directories
Squid startup not setting permissions on cache directories
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: squid (Show other bugs)
2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jay Fenlason
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-06-17 05:55 EDT by John Horne
Modified: 2014-08-31 19:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-06-17 18:14:57 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description John Horne 2004-06-17 05:55:32 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040510

Description of problem:
Installed squid. Configured squid to use separate cache and log disk
partitions - that is, I set the 'cache_dir' and 'cache_log' options.
Starting squid fails because the disk partitions are mounted as root -
they need to be owned by the user 'squid'.

I have modifed /etc/init.d/squid to fix this. At line 49 put:

49:  [ -z "$CACHE_SWAP" ] && CACHE_SWAP=/var/spool/squid
50:
51:  # determine which one is the cache_log directory
52:  CACHE_LOG=`sed -e 's/#.*//g' /etc/squid/squid.conf | \
53:          grep cache_log |  awk '{ print $2 }'`
54:  [ -z "$CACHE_LOG" ] && CACHE_LOG=/var/log/squid/xx
55:  CACHE_LOG=`dirname $CACHE_LOG`

Then further down simply change the script to:

  start() {
      for adir in $CACHE_LOG; do
          chown squid:squid $adir
          chmod 0770 $adir
      done

      for adir in $CACHE_SWAP; do
          chown squid:squid $adir
          chmod 0770 $adir

This now takes care of the permissions for any cache_dir or cache_log
entries. CACHE_LOG could be expanded to include some of the other
squid 'log' directives - such as, cache_store_log.


John.

Version-Release number of selected component (if applicable):
squid-2.5.STABLE5-4.fc2

How reproducible:
Always

Steps to Reproduce:
1. Install squid and configure the cache_dir/cache_log options to use
specific disk partitions.
2. Make the disk partitions and create the mount points. Modify
/etc/fstab to mount the partitions.
3. Reboot the system and start up squid.
    

Actual Results:  Squid start up fails because the disk partitions are
mounted as root. Squid gives 'permission denied' errors (in cache_log
and access_log).

Expected Results:  Squid should start up and set the disk partitions
onwer and group id's as well as the mode.

Additional info:
Comment 1 John Horne 2004-06-17 17:25:25 EDT
Sorry, but I think you can close this one as 'user error'.

I shutdown squid, unmounted the relevant partitions and then set the
permissions on the mount points to 'squid:squid' with mode 770 and
then rebooted. The squid cache and log disk partitions were correctly
mounted with the correct ownership and mode. Squid came up fine. (I
had already removed the bit I added to the startup script.)

Apologies for the hassle.


John.

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