LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-07-2006, 03:10 AM   #1
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676
Blog Entries: 7

Rep: Reputation: 32
Squid stops working..-->clear rebuild cache


Hi
Ive installed squid on a debian system using webmin to administrate it...It serves 30 computers and it has been doing fine for the first 5 days ..on the sixth day it stopped working and any request on port 80 would only result in the typical IE page.."The page you requested...404"...NOT the squid error page...so I cleared and rebuilt the cache and everything worked allright..what must I do to prevent this from happening again .

P.S.. the syslogs did not reveal anything about the issue
 
Old 07-07-2006, 06:30 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
could it be that you had accidentally deleted the cache?? granted, i'm not sure if that would actually produce those kinda effects (IE's error page instead of Squid's), but maybe you can try and see if it does...

also, did you try doing other things before you rebuilt the cache?? maybe a reboot, restarting squid, or something like that?? i'm just wondering whether restarting squid (without rebuilding the cache) would have brought it back online...
 
Old 07-07-2006, 06:37 AM   #3
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
AFAIK, if squid doesnot finds the cache directory it will complain and fail to start. you have to create the dir manually and see to it that squid has proper permission to write to it.
 
Old 07-07-2006, 06:46 AM   #4
ALInux
Member
 
Registered: Nov 2003
Location: Lebanon
Distribution: RHEL 5/CentOS 5/Debian Lenny/(K)Ubuntu Is Dead/Mandriva 10.1
Posts: 676

Original Poster
Blog Entries: 7

Rep: Reputation: 32
I surely did not erase the cache..because the problem happened out of a sudden without me touching the whole system for a couple of days..and I tried the usual stuff reboot squid..etc..and even a system reboot "The result of a power outage --Typical in Lebanon--
 
Old 07-07-2006, 06:46 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by prozac
AFAIK, if squid doesnot finds the cache directory it will complain and fail to start. you have to create the dir manually and see to it that squid has proper permission to write to it.
okay, then this adds weight to the idea that the cache was deleted/altered on day 6... IIRC a "squid -z" won't fix permissions, so if it was permissions then the cache wouldn't have been able to be rebuilt - unless the webmin front-end takes care of permissions also when rebuilding...
 
Old 07-07-2006, 06:47 AM   #6
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by ALInux
I surely did not erase the cache..because the problem happened out of a sudden without me touching the whole system for a couple of days..and I tried the usual stuff reboot squid..etc..and even a system reboot "The result of a power outage --Typical in Lebanon--
wait, this started to happen right after a power outage??

Last edited by win32sux; 07-07-2006 at 07:07 AM.
 
Old 07-07-2006, 10:11 AM   #7
prozac
Member
 
Registered: Oct 2005
Location: Australia
Distribution: slackware 12.1
Posts: 753

Rep: Reputation: 32
you should check if the cache dir exists and has proper permissions.
 
Old 07-07-2006, 10:16 AM   #8
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by prozac
you should check if the cache dir exists and has proper permissions.
i don't think he would have been able to rebuild the cache if the cache_dir didn't exist and/or didn't have acceptable permissions:
Quote:
Originally Posted by ALInux
so I cleared and rebuilt the cache and everything worked allright..
 
Old 07-07-2006, 10:27 AM   #9
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
actually, i take that back... i just tried it and it seems "squid -z" will create the cache dir (with proper permissions) if it doesn't exist... yet, it will (of course) terminate if the cache dir doesn't have the right permissions... examples:

Code:
bash-3.00# whoami
root
bash-3.00# ls -l /var/lib/squid/
total 5
-rwxr-xr-x  1 squid squid 650 2006-06-07 13:15 redirector.pl
drwxr-x---  2 squid squid  80 2006-06-05 06:23 logs
bash-3.00# squid -z
2006/07/07 10:25:31| Creating Swap Directories
bash-3.00# ls -l /var/lib/squid/
total 6
drwxr-xr-x  34 squid squid 816 2006-07-07 10:25 cache
-rwxr-xr-x   1 squid squid 650 2006-06-07 13:15 redirector.pl
drwxr-x---   2 squid squid  80 2006-06-05 06:23 logs
Code:
bash-3.00# whoami
root
bash-3.00# ls -l /var/lib/squid/
total 5
-rwxr-xr-x  1 squid squid 650 2006-06-07 13:15 redirector.pl
drwxr-x---  2 squid squid  80 2006-06-05 06:23 logs
bash-3.00# mkdir /var/lib/squid/cache
bash-3.00# ls -l /var/lib/squid/
total 5
drwxr-xr-x  2 root  root   48 2006-07-07 10:26 cache
-rwxr-xr-x  1 squid squid 650 2006-06-07 13:15 redirector.pl
drwxr-x---  2 squid squid  80 2006-06-05 06:23 logs
bash-3.00# squid -z
2006/07/07 10:26:43| Creating Swap Directories
FATAL: Failed to make swap directory /var/lib/squid/cache/00: (13) Permission denied
Squid Cache (Version 2.5.STABLE14): Terminated abnormally.
CPU Usage: 0.010 seconds = 0.000 user + 0.010 sys
Maximum Resident Size: 0 KB
Page faults with physical i/o: 8
bash-3.00# chown squid:squid /var/lib/squid/cache 
bash-3.00# squid -z
2006/07/07 10:27:06| Creating Swap Directories
FWIW, i actually have the cache dir set to 770, so users don't snoop around in there:
Code:
chmod 770 /var/lib/squid/cache

Last edited by win32sux; 07-07-2006 at 10:35 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to clear apt-cache coyopil Debian 6 01-29-2014 12:15 AM
how do you clear the cache? eagletalontim Linux - Newbie 11 01-11-2006 03:05 PM
clear or disable file cache acristescu Linux - General 3 11-04-2005 10:25 AM
Help me clear ALL dhcp (client) cache! carboncopy Slackware 4 06-28-2004 08:42 AM
Clear cache raysr Linux - Newbie 2 03-26-2004 01:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration