wellscs Posted March 16, 2009 Posted March 16, 2009 I have just inherited a squid proxy server (on linux)that i have never worked or had any experience on. I came in this morning the internet had stopped. after a couple of reboots reboot it works for about 30 mins each time and then stops. If I restart the services it will restart. With my lack of experience, although I am learning quickly I'm not sure how to fix this. Any help gatefully received Paul
pete Posted March 16, 2009 Posted March 16, 2009 Well maybe you could follow up on your two other posts on the same subject? Where I did post some advice? http://www.edugeek.net/forums/internet-related-filtering-firewall/32298-squid-box-not-working-help.html
Hightower Posted March 16, 2009 Posted March 16, 2009 Well maybe you could follow up on your two other posts on the same subject? Where I did post some advice? http://www.edugeek.net/forums/internet-related-filtering-firewall/32298-squid-box-not-working-help.html I was just thinking I've seen this before, recently, more than once.
wellscs Posted March 16, 2009 Author Posted March 16, 2009 I have tried the advice given, but not sure what the logs mean was hoping perhaps as this is supposed to be a helping site, someone might take a look at the logs for me to help me out. perhaps this is not a site that helps people anymore
wellscs Posted March 16, 2009 Author Posted March 16, 2009 I was also advised to re post to this area by Geoff
Hightower Posted March 16, 2009 Posted March 16, 2009 I was also advised to re post to this area by Geoff 3 posts? Just re-post in your old post. And if you want people to look at your logs then perhaps its a good idea to firstly, state that in your post, and secondly, post your logs so people can view them. Your 3 posts have said exactly the same in each. We're a very helping community, but unfortunately I left my Crystal ball at home today.
wellscs Posted March 16, 2009 Author Posted March 16, 2009 wcsstore.doc wcscache.doc wcssyslog.doc I have attached some log files Thanks
Iain Posted March 16, 2009 Posted March 16, 2009 Looks like you've run out of space on the disk / partition that the log files are stored on.
Hightower Posted March 16, 2009 Posted March 16, 2009 [ATTACH]3510[/ATTACH] [ATTACH]3511[/ATTACH] [ATTACH]3512[/ATTACH] I have attached some log files Thanks Ok, I'm no guru with Squid or *nix but it appears to be that your cache is full and this might be causing it. I've found this site - see if this is useful. RE: [squid-users] squid tries to rebuild cache but fails... - Unix Linux Forum
Geoff Posted March 16, 2009 Posted March 16, 2009 running df -h will show you if your disk(s) are full. 1
wellscs Posted March 16, 2009 Author Posted March 16, 2009 Filesystem Size Used Avail Use% Mounted on /dev/sda1 71G 68G 0 100% / varrun 1013M 344K 1013M 1% /var/run varlock 1013M 0 1013M 0% /var/lock udev 1013M 68K 1013M 1% /dev devshm 1013M 12K 1013M 1% /dev/shm lrm 1013M 38M 976M 4% /lib/modules/2.6.24-16-generic/volatile gvfs-fuse-daemon 71G 68G 0 100% /root/.gvfs /dev/sdc1 233G 59M 233G 1% /media/disk
Hightower Posted March 16, 2009 Posted March 16, 2009 (edited) Filesystem Size Used Avail Use% Mounted on /dev/sda1 71G 68G 0 100% / varrun 1013M 344K 1013M 1% /var/run varlock 1013M 0 1013M 0% /var/lock udev 1013M 68K 1013M 1% /dev devshm 1013M 12K 1013M 1% /dev/shm lrm 1013M 38M 976M 4% /lib/modules/2.6.24-16-generic/volatile gvfs-fuse-daemon 71G 68G 0 100% /root/.gvfs /dev/sdc1 233G 59M 233G 1% /media/disk the 1st line: /dev/sda1 is full - you need to clean up your logs a bit - sorry I can't be of more help but I've just started using Squid myself. I'm sure Geoff will be along in a minute with a quick fix. Edited March 16, 2009 by Hightower
Iain Posted March 16, 2009 Posted March 16, 2009 (edited) Yep, your root partition /dev/sha1 which contains the root of your filesystem / is full. You'll need to do some cleaning up. My guess is that it's full of old logfiles. Take a look into log rotation for automatic management of your log files. Edited March 16, 2009 by Iain Add link to info about logrotate daemon
wellscs Posted March 16, 2009 Author Posted March 16, 2009 Thanks for all your replies, seems we are getting somwhere. remembering Im a compl:)ete novice at this can someone help me with the code to empty/ rotate/compact my log files Thanks to everyone again
pete Posted March 16, 2009 Posted March 16, 2009 (edited) To ensure it is squid, (and not, say dansguardian as well), cd into /var/logs and use: du -h --max-depth=1 Which will give you the space consumed by each directory / log. I'm assuming you're using Ubuntu (by the presence of gvfs-daemon). From a terminal, issue: sudo /etc/init.d/squid stop If you care about the logs (ideally you should), plug in a removable hard disk and copy the squid logs to it - there's not enough space to compress them on your drive at the moment. If you're running the gnome desktop it should automount the usb drive. Once the squid log is copied somewhere else, su to root temporarily by using: sudo -s then type > /var/log/squid/access.log to zero the contents of the file, but keep it and the permissions in place. Type exit to discard root credentials then type: sudo /etc/init.d/squid start Your squid box will now run ok for a while, but you need to get log rotation sorted or this will happen again. NB: It's very rare I remember to check pms - posting in thread is the best way to attract my attention. Edited March 16, 2009 by pete
Geoff Posted March 16, 2009 Posted March 16, 2009 Log rotation is done by the 'logrotate' package (cryptic eh?). To install it on an ubuntu machine do the following: apt-get install logrotate To manually logrotate your squid log files run the following: logrotate -f -s /var/lib/logrotate.status /etc/logrotate.d/squid
wellscs Posted March 16, 2009 Author Posted March 16, 2009 i get this far WCSLOBSTER ~ # sudo /etc/init.d/squid stop * Stopping Squid HTTP proxy squid [ OK ] WCSLOBSTER ~ # sudo -s WCSLOBSTER ~ # /var/log/squid/access.log bash: /var/log/squid/access.log: Permission denied WCSLOBSTER ~ #
wellscs Posted March 16, 2009 Author Posted March 16, 2009 WCSLOBSTER ~ # apt-get install logrotate Reading package lists... Done Building dependency tree Reading state information... Done Recommended packages: mailx The following packages will be upgraded: logrotate 1 upgraded, 0 newly installed, 0 to remove and 254 not upgraded. Need to get 36.9kB of archives. After this operation, 0B of additional disk space will be used. Get: 1 Index of / hardy-updates/main logrotate 3.7.1-3ubuntu0.8.04 [36.9kB] Fetched 36.9kB in 0s (105kB/s) (Reading database ... 117927 files and directories currently installed.) Preparing to replace logrotate 3.7.1-3 (using .../logrotate_3.7.1-3ubuntu0.8.04_i386.deb) ... Unpacking replacement logrotate ... Setting up logrotate (3.7.1-3ubuntu0.8.04) ... WCSLOBSTER ~ # logrotate -f -s /var/lib/logrotate.status /etc/logrotate.d/squid 2009/03/16 14:56:14| WARNING: Very large maximum_object_size_in_memory settings can have negative impact on performance squid: ERROR: Could not send signal 10 to process 6670: (3) No such process error: error running shared postrotate script for /var/log/squid/*.log WCSLOBSTER ~ #
wellscs Posted March 16, 2009 Author Posted March 16, 2009 how can i can clear this /dev/sda1 71G 68G 0 100% /
Hightower Posted March 16, 2009 Posted March 16, 2009 Has stopped working all together now What did you do to stop it working?
pete Posted March 16, 2009 Posted March 16, 2009 To clear the log file. From a terminal, type: sudo /etc/init.d/squid stop If you care about the logs (ideally you should), plug in a removable hard disk and copy the squid logs to it - there's not enough space to compress them on your drive at the moment. If you're running the gnome desktop it should automount the usb drive. If you don't care about the log file type: sudo -s then type: > /var/log/squid/access.log which will zero the contents of the log file (make it blank and take up no space) , but keep it and the permissions in place. Type exit to discard root credentials then type: sudo /etc/init.d/squid start
wellscs Posted March 17, 2009 Author Posted March 17, 2009 I can only get this far sudo /etc/init.d/squid stop * Stopping Squid HTTP proxy squid [ OK ] WCSLOBSTER ~ # /var/log/squid/access.log bash: /var/log/squid/access.log: Permission denied nit working at all now
wellscs Posted March 17, 2009 Author Posted March 17, 2009 WCSLOBSTER ~ # sudo /etc/init.d/squid stop * Stopping Squid HTTP proxy squid [ OK ] WCSLOBSTER ~ # /var/log/squid/access.log bash: /var/log/squid/access.log: Permission denied WCSLOBSTER ~ # logrotate -f -s /var/lib/logrotate.status /etc/logrotate.d/squid WCSLOBSTER ~ # apt-get install logrotate Reading package lists... Done Building dependency tree Reading state information... Done logrotate is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 262 not upgraded. WCSLOBSTER ~ # logrotate -f -s /var/lib/logrotate.status /etc/logrotate.d/squid WCSLOBSTER ~ # Sorry do all that i am beeing such a pain this is like a new language to me
Hightower Posted March 17, 2009 Posted March 17, 2009 Did you type the sudo -s line before you entered /var/log/squid/access.log? Just seems that you aren't carrying out the tasks as a super user therefore you don't have permissions.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now