Re: [squid-users] Squid won't start with 2 cache_dirs configured

From: Daniel A. Ramaley <daniel.ramaley@dont-contact.us>
Date: Tue, 25 Oct 2005 17:22:19 -0500

On Tuesday 25 October 2005 16:38, Joost de Heer wrote:
>> I temporarily set permissions on both /cache and /cache/squid to
>> 777. I still get the same error. Besides overly strict permissions,
>> is there anything else that would cause Squid to give "Permission
>> denied"? Or is there anything else i should try?
>
>- What filesystem is on /cache/squid?
>- How is it mounted? (show the relevant line from /proc/mounts)

Just for reference (since my original post has been removed in the
replis) the cache_dir lines from my squid.conf are:
    cache_dir ufs /cache/squid 6856 16 256
    cache_dir ufs /var/spool/squid 1000 16 256

Both filesystems are ext3. Here's the info from /proc/mounts:
    $ cat /proc/mounts | grep -E '(cache|var)'
    /dev/sda1 /cache ext3 rw 0 0
    /dev/hda5 /var ext3 rw 0 0
Other than being on different drives, they look the same to me. The SCSI
drive (sda) was added to the system specifically to hold the squid
cache. The drive works fine and i can read and write files to it
without problems.

Also, both partitions do have plenty of free space:
    $ df -h /cache /var
    Filesystem Size Used Avail Use% Mounted on
    /dev/sda1 8.4G 68M 7.9G 1% /cache
    /dev/hda5 3.9G 270M 3.4G 8% /var

Any ideas?

Just for the heck of it, i changed the cache_dir lines to:
    cache_dir ufs /usr/squid 1000 16 256
    cache_dir ufs /var/spool/squid 1000 16 256
Some stats on /usr:
    $ cat /proc/mounts | grep usr
    /dev/hda3 /usr ext3 rw 0 0
    $ df -h /usr
    Filesystem Size Used Avail Use% Mounted on
    /dev/hda3 3.9G 654M 3.1G 18% /usr
So, like /var and /cache, /usr is ext3 and has plenty of free space. I
created the directory /usr/squid and set permissions:
    $ ls -ld /usr/squid
    drwxr-xr-x 18 squid squid 4096 Oct 25 16:57 /usr/squid
Running "squid -z" created all the subdirectories as one would expect:
    $ ls -l /usr/squid
    total 128
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 00
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 01
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 02
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 03
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 04
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 05
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 06
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 07
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 08
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 09
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0A
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0B
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0C
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0D
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0E
    drwxr-xr-x 258 squid squid 4096 Oct 25 16:57 0F
But when i start Squid i still get lots of errors:

2005/10/25 16:58:48| Starting Squid Cache version 2.5.STABLE6 for
i386-redhat-linux-gnu...
2005/10/25 16:58:48| Process ID 2685
2005/10/25 16:58:48| With 1024 file descriptors available
2005/10/25 16:58:48| DNS Socket created at 0.0.0.0, port 32769, FD 4
2005/10/25 16:58:48| Adding nameserver 10.1.0.26 from /etc/resolv.conf
2005/10/25 16:58:48| Adding nameserver 10.1.0.25 from /etc/resolv.conf
2005/10/25 16:58:48| User-Agent logging is disabled.
2005/10/25 16:58:48| Referer logging is disabled.
2005/10/25 16:58:48| Unlinkd pipe opened on FD 9
2005/10/25 16:58:48| Swap maxSize 2048000 KB, estimated 157538 objects
2005/10/25 16:58:48| Target number of buckets: 7876
2005/10/25 16:58:48| Using 8192 Store buckets
2005/10/25 16:58:48| Max Mem size: 8192 KB
2005/10/25 16:58:48| Max Swap size: 2048000 KB
2005/10/25 16:58:48| /usr/squid/swap.state: (13) Permission denied
FATAL: storeUfsDirOpenSwapLog: Failed to open swap log.
Squid Cache (Version 2.5.STABLE6): Terminated abnormally.
CPU Usage: 0.060 seconds = 0.037 user + 0.023 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 0

I tried creating swap.state and swap.state.last-clean, since both files
exist in /var/spool/squid:
    # ls -l /usr/squid/swap.state*
    -rw-r--r-- 1 squid squid 0 Oct 25 17:15 /usr/squid/swap.state
    -rw-r--r-- 1 squid squid 0 Oct 25
17:17 /usr/squid/swap.state.last-clean

When attempting to restart Squid, i still get the error:
2005/10/25 17:17:28| /usr/squid/swap.state: (13) Permission denied

Weird. As far as i can tell, Squid has permission to read and write the
necessary files, but still says permission denied...

------------------------------------------------------------------------
Dan Ramaley
Network Programmer/Analyst
(515) 271-4540
Dial Center 118, Drake University
Received on Tue Oct 25 2005 - 16:22:42 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Nov 01 2005 - 12:00:05 MST