problem with cache_dir in squid
I changed the cache_dir in squid.conf and restart squid, but it failed to start. However as i set the cache_dir to the default it starts.
I have made two partitions to store cache i.e /cache1 and /Cache2 of about 20gb space, now as i do the following changes cache_dir ufs /Cache1/squid 18000 16 256 cache_dir ufs /Cache2/squid 18000 16 256 then squid doesnot start. and as i comment the above statement(i.e. setting the cache to default /var/spool/squid 100 16 256) it starts working. plz help me to change the cache_dir.... what error i am doing. kindly guide |
After changing the cache_dir location you should run
Code:
squid -z Regards |
Quote:
I have tried but still it is not working. |
What error do you get? Check the logfiles to see if you find out why squid does not start.
What is the output of: Code:
ls -l /Cache1/squid |
Make sure that the new directory's owner is the same as the owner running squid, usually proxy. I had a similar problem like that.
chown proxy <dirname> Hope that helps. |
Quote:
This is the output of cache.log when I changed the cache_dir. 2008/10/16 12:18:35| Starting Squid Cache version 2.5.STABLE6 for i386-redhat-linux-gnu... 2008/10/16 12:18:35| Process ID 3936 2008/10/16 12:18:35| With 1024 file descriptors available 2008/10/16 12:18:35| DNS Socket created at 0.0.0.0, port 32771, FD 4 2008/10/16 12:18:35| Adding nameserver 202.147.176.40 from /etc/resolv.conf 2008/10/16 12:18:35| Adding nameserver 202.147.176.41 from /etc/resolv.conf 2008/10/16 12:18:35| User-Agent logging is disabled. 2008/10/16 12:18:35| Referer logging is disabled. 2008/10/16 12:18:35| Unlinkd pipe opened on FD 9 2008/10/16 12:18:35| Swap maxSize 36864000 KB, estimated 2835692 objects 2008/10/16 12:18:35| Target number of buckets: 141784 2008/10/16 12:18:35| Using 262144 Store buckets 2008/10/16 12:18:35| Max Mem size: 524288 KB 2008/10/16 12:18:35| Max Swap size: 36864000 KB 2008/10/16 12:18:35| /Cache1/squid: (13) Permission denied 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.5.STABLE6): Terminated abnormally. CPU Usage: 0.012 seconds = 0.005 user + 0.007 sys Maximum Resident Size: 0 KB Page faults with physical i/o: 0 The output of ls -l is given below: ls -l /Cache1/squid total 128 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 00 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 01 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 02 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 03 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 04 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 05 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 06 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 07 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 08 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 09 drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0A drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0B drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0C drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0D drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0E drwxr-xr-x 258 squid squid 4096 Oct 9 10:53 0F In the light of the above output please guide me. Thanks |
The cache.log you've posted is from when you're trying to start squid normally. I suggest you to delete the swap dirs and start over:
Code:
rm -rf /Cache1 From the logfile I see that you run Redhat. Check if it's not a SELinux problem |
Quote:
Actually /Cache1 and /Cache2 are the partitions created at the time of installation of redhat linux and the squid directory was created later on in both the partitions. when I run squid -z it gives OK report. but then it fails to stop or start. The permissions were set both to root user and squid but in vain. Any further guidance will be highly appreciated. |
Are you sure it's not a SELinux problem?
If I was you, I would delete those dirs and recreate them with the above procedure. Just make sure there is nothing else under /Cache1 /Cache2 and that squid is not running. |
Quote:
rm -rf /Cache1 rm: cannot remove directory `/Cache1': Device or resource busy please help me. |
don't make any dircectory within the cache1 partition and if you running the default squid which shiped with the OS I don't think changing directory for cache will work with that defaul squid package try to get a new squid download from
www.squid-cache.org then install the package and give your cache path from the squid.conf, I hope it will work. thanks shahz |
Quote:
|
Quote:
Output of vi /etc/fstab # This file is edited by fstab-sync - see 'man fstab-sync' for details LABEL=/ / ext3 defaults 1 1 LABEL=/Cache1 /Cache1 ext3 defaults 1 2 LABEL=/Cache2 /Cache2 ext3 defaults 1 2 LABEL=/boot /boot ext3 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 LABEL=/home /home ext3 defaults 1 2 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 LABEL=/tmp /tmp ext3 defaults 1 2 LABEL=/usr /usr ext3 defaults 1 2 LABEL=/var /var ext3 defaults 1 2 LABEL=SWAP-sda11 swap swap defaults 0 0 /dev/hda /media/cdrecorder auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0 /dev/fd0 /media/floppy auto pamconsole,fscontext=system_u:object_r:removable_t,exec,noauto,managed 0 0 ~ ~ |
when you are within the partition/directory you can't remove direcotry. umount the partition and then remove the direcotry.
thanks shahz |
Ok, don't delete /Cache1, delete /Cache1/squid, recreate it and try again:
Code:
rm -rf /Cache1/squid |
All times are GMT -5. The time now is 01:46 AM. |