Squid fails to start
-
Just did a clean reinstall and now Squid fails to start. Exact same configuration as before. Even executed squid -z but has no effect.
Here is the log..
2011/04/30 20:22:03| Starting Squid Cache version 2.7.STABLE9 for amd64-portbld-freebsd8.1…
2011/04/30 20:22:03| Process ID 62394
2011/04/30 20:22:03| With 11095 file descriptors available
2011/04/30 20:22:03| Using kqueue for the IO loop
2011/04/30 20:22:03| DNS Socket created at 0.0.0.0, port 22805, FD 6
2011/04/30 20:22:03| Adding domain localdomain from /etc/resolv.conf
2011/04/30 20:22:03| Adding nameserver 208.67.222.222 from /etc/resolv.conf
2011/04/30 20:22:03| Adding nameserver 208.67.220.220 from /etc/resolv.conf
2011/04/30 20:22:03| Referer logging is disabled.
2011/04/30 20:22:03| logfileOpen: opening log /var/squid/log/access.log
2011/04/30 20:22:03| Unlinkd pipe opened on FD 11
2011/04/30 20:22:03| Swap maxSize 3072000 + 614400 KB, estimated 283569 objects
2011/04/30 20:22:03| Target number of buckets: 14178
2011/04/30 20:22:03| Using 16384 Store buckets
2011/04/30 20:22:03| Max Mem size: 614400 KB
2011/04/30 20:22:03| Max Swap size: 3072000 KB
2011/04/30 20:22:03| Local cache digest enabled; rebuild/rewrite every 3600/3600 sec
2011/04/30 20:22:03| Store logging disabled
2011/04/30 20:22:03| /var/squid/cache/10: (2) No such file or directory
FATAL: Failed to verify one of the swap directories, Check cache.log
for details. Run 'squid -z' to create swap directories
if needed, or if running Squid for the first time.
Squid Cache (Version 2.7.STABLE9): Terminated abnormally.
CPU Usage: 0.144 seconds = 0.068 user + 0.076 sys
Maximum Resident Size: 6176 KB
Page faults with physical i/o: 0 -
If I keep the "Level 1 subdirectories" to 16 it starts, but if I select 32/65/128 it dies with the same errors.
And the log shows below errors while the Squid service is up.
2011/04/30 20:44:34| storeDirClean: /var/squid/cache/07/7F: (13) Permission denied
2011/04/30 20:44:49| storeDirClean: /var/squid/cache/08/7F: (13) Permission denied
2011/04/30 20:45:04| storeDirClean: /var/squid/cache/09/7F: (13) Permission denied
2011/04/30 20:45:19| storeDirClean: /var/squid/cache/0A/7F: (13) Permission denied
2011/04/30 20:45:24| storeAufsOpenDone: (13) Permission denied
2011/04/30 20:45:24| /var/squid/cache/00/00/00000000
2011/04/30 20:45:24| storeSwapOutFileClosed: dirno 0, swapfile 00000000, errflag=-1
(13) Permission denied
2011/04/30 20:45:24| storeAufsOpenDone: (13) Permission denied
2011/04/30 20:45:24| /var/squid/cache/00/00/00000001
2011/04/30 20:45:24| storeSwapOutFileClosed: dirno 0, swapfile 00000001, errflag=-1
(13) Permission denied
2011/04/30 20:45:34| storeDirClean: /var/squid/cache/0B/7F: (13) Permission denied
2011/04/30 20:45:49| storeDirClean: /var/squid/cache/0C/7F: (13) Permission denied
2011/04/30 20:46:04| storeDirClean: /var/squid/cache/0D/7F: (13) Permission denied
2011/04/30 20:46:19| storeDirClean: /var/squid/cache/0E/7F: (13) Permission denied
2011/04/30 20:46:34| storeDirClean: /var/squid/cache/0F/7F: (13) Permission denied
2011/04/30 20:46:49| storeDirClean: /var/squid/cache/00/80: (13) Permission denied
2011/04/30 20:47:04| storeDirClean: /var/squid/cache/01/80: (13) Permission denied
2011/04/30 20:47:19| storeDirClean: /var/squid/cache/02/80: (13) Permission denied
2011/04/30 20:47:34| storeDirClean: /var/squid/cache/03/80: (13) Permission denied
2011/04/30 20:47:42| storeAufsOpenDone: (13) Permission denied
2011/04/30 20:47:42| /var/squid/cache/00/00/00000002
2011/04/30 20:47:42| storeSwapOutFileClosed: dirno 0, swapfile 00000002, errflag=-1
(13) Permission denied
2011/04/30 20:47:49| storeDirClean: /var/squid/cache/04/80: (13) Permission denied -
chown -R proxy:proxy /var/squid/cache
Not sure how what might have stomped on that.
-
I have tried that command already. That didn't work.
I figured out the issue. Not sure if it's something to do with the latest snapshots or Squid itself. Pretty sure its not Squid as this issue never came up in builds before April 10th.
When you install Squid the directory /var/squid/cache is deprived of system rights on "write" to a degree that Squid cannot crate the sub directories and fails to start.What I did was.. installed Squid, configured it, rebooted. Squid fails to start on first reboot. Deleted /var/squid/cache directory through File Manager and then went into packages and did a Squid "reinstall" package. This time the reinstall creates the cache directory with the correct access permissions. Reboot again to ensure everything is in order.
I had one question on the level of Squid configuration. Please shed some light on this.
I have 4GB RAM and 120GB hdd.
What would be the best performance settings in Squid Cache Mgmt for..
- Hard disk cache size = ? (I have it at 3000MB)
- HArd Disk cache system = ? ( I have aufs)
- Memory cache size = ? (I have 1000MB)
- Minimum object size = ? (default 0 is fine??)
- Maximum object size = ? (I have 256KB)
- Level 1 subdirectories = ? (I have it at 16, should I go for more? If so how much?)
- Memory replacement policy = ? (I have Heap LFUDA)
8 ) Cache replacement policy = ? (I have Heap LFUDA)