Bug 126189 - Squid startup not setting permissions on cache directories
Summary: Squid startup not setting permissions on cache directories
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: squid
Version: 2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jay Fenlason
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-06-17 09:55 UTC by John Horne
Modified: 2014-08-31 23:26 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-06-17 22:14:57 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description John Horne 2004-06-17 09:55:32 UTC
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 21:25:25 UTC
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.