Results 1 to 10 of 19
Hi,
Squid proxy is running on Cent OS 6, recently we installed squish for the squid, every time when the squish.cron.sh (runs for every 5 mins.) . squid status says ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-18-2012 #1Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
squid dies after every 5 to 10 mins (squid dead but pid file exist)
Hi,
Squid proxy is running on Cent OS 6, recently we installed squish for the squid, every time when the squish.cron.sh (runs for every 5 mins.) . squid status says " squid dead but pid file exist."
Its too difficult to restart squid every time..
any help please ! !
- 09-20-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
Can you show the contents of the squish.cron.sh script?
Maybe try running squid in the foreground, w/debugging enabled, e.g.:
Is there anything helpful in the logs (/var/log/squid/*)?Code:squid -N -X
Is there an update to the squid package for your version of CentOS? I see that there is an update for 6.3:
http://mirror.centos.org/centos-6/6....6_3.x86_64.rpm
- 09-20-2012 #3Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
before installing squish it was nice, but after installing squish its happened. i'll try to update the OS.
squid.out log:
squid: ERROR: Could not send signal 0 to process 32560: (3) No such process
squid: ERROR: Could not send signal 0 to process 3328: (3) No such process
squid: ERROR: Could not send signal 0 to process 3328: (3) No such process
squid: ERROR: Could not send signal 0 to process 11541: (3) No such process
squid: ERROR: Could not send signal 0 to process 4721: (3) No such process
squid: ERROR: Could not send signal 0 to process 31313: (3) No such process
- 09-20-2012 #4Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
sorry forgot to mention squish.cron.sh
pls find code.
Code:#!/bin/bash # squish.cron.sh -- Quick and DIRTY squid log analysis # # Assemble squid logs, and send through squish.pl. This script gets run on a # regular basis. It will install itself in crontab if you give it a chance. # # Copyright (c) 2001-2002 Andrew McGill and Leading Edge Business Solutions # (South Africa). This software may be redistributed and/or modified only # under the terms of the GNU General Public Licence, version 2, as published by # the Free Software Foundation, and contained in the file COPYING. # # All other rights are reserved, and no warranty is implied. Despite any # appearance to the contrary, this software is not fit for ANY purpose you may # conceive, and should not be used on your system under any circumstances. REVISION='$Id: squish.cron.sh,v 1.4 2006/01/05 10:05:23 andrewm Exp $' SHORTREVISION="${REVISION/*,v }" SHORTREVISION="${SHORTREVISION/ *}" # You can override automatic 'detection' by editing this, or by setting # an environmnet variable: # Irix doesn't have -maxdepth 1 on find, so we'll work around it FINDOPTS="-maxdepth 1" find /dev/null $FINDOPTS >& /dev/null || FINDOPTS= # Find a nice place to put the output - semi-automatic nonsense that is bound # to fail sooner or later. If you don't like this, you can change BASEDIR and # LOGDIR above [ "$LOGDIR" ] || for DIR in \ /var/squid/logs \ /var/log/squid \ /usr/local/squid/var/logs \ ; do if [ -d $DIR ] ; then LOGDIR=$DIR; fi done [ "$LOGDIR" ] || { echo 1>&2 "Please set LOGDIR in $0"; exit 1; } umask 002 # If we are not on a tty, then log to file tty -s || { exec >& $BASEDIR/squish.log date trap "date" EXIT } function checkcrontab() { # install CRONTAB if crontab is writable CRONTAB="/etc/crontab" [ -w $CRONTAB ] || return grep -q "squish" $CRONTAB || echo "# squish squishy squid */5 * * * * root /usr/local/squish/squish.cron.sh " >> $CRONTAB && killall -1 cron crond 2>/dev/null echo "Modified /etc/crontab" } # Find the access logs, and concatenate them to stdout in the right order # (ie. in the order in which the events happened) function cataccesslogs() { if [ $ALL ] ; then DAYS=365 # older than a year is off the graph find $LOGDIR $FINDOPTS -name "access.log*" -mtime -$DAYS | xargs ls -tr /dev/null else find $LOGDIR $FINDOPTS -name "access.log" fi | while read LOGFILE ; do [ -r "$LOGFILE" ] && case "$LOGFILE" in *.gz) zcat "$LOGFILE" ;; *.bz2) bzcat "$LOGFILE" ;; *) cat "$LOGFILE" ;; esac done } function doreport() { # Unzip files before use ... # find $LOGDIR $FINDOPTS -name "access.log-*.gz" -mtime -$DAYS -exec gun zip {} \; DIR=`dirname $0` cd $DIR cataccesslogs | $DIR/squish.pl } # options processing ... ALL= case "$1" in --install) ALL=1 ;; esac doreport exit 0Last edited by sureshk; 09-20-2012 at 05:55 AM. Reason: speelling mistakes
- 09-21-2012 #5Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
that is a very convoluted script.
in order to troubleshoot, i would start squid in the foreground, like I mentioned above, then run this simpler version of the above code:
Code:#!/bin/bash for log in $(find /var/squid/logs /var/log/squid /usr/local/squid/var/logs -name "access.log"); do printf "\nLOG: $log\n" cat $log | /path/to/squish.pl done
just make sure that you change /path/to/squish.pl to reflect where that script is located on your system.
also, make sure crond is not running, to prevent the original squish.cron.sh from running concurrently.
- 09-24-2012 #6Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
Because of Internet problem I am giving reply lately.
I run the simple code which you given and its run properly and the users were squished with this code it self.
And I did not find any errors and the squid runs properly when I disable squid.cron.sh
what should be the next step that I have to do.?
- 09-27-2012 #7Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
sorry for the late response...
so if it works for you like it is code, you can try running it in cron, instead of the other script. i'm not sure where your cron job is located, do you know where it is? If you don't, try looking in /var/spool/cron/root and the /etc/cron.* directories.
- 09-27-2012 #8Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
thanks for the reply..
cron job was located at /etc/crontab
I gave permissions for the code which you given as 755
and I added like in to cron job ..
and tried also like thisCode:*/5 * * * * root /usr/local/squish/squishing.sh
The problem is it's executing properly when I run manually but not working through the cron job.Code:*/5 * * * * /usr/bin/sh /usr/local/squish/squishing.sh
Cron Log :
Thank you.Code:Sep 27 10:40:01 proxy3 CROND[22041]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok) Sep 27 10:40:01 proxy3 CROND[22042]: (root) CMD (/usr/lib64/sa/sa1 -S DISK 1 1) Sep 27 10:40:01 proxy3 CROND[22043]: (root) CMD (/usr/local/squish/squishing.sh) Sep 27 10:45:01 proxy3 CROND[22208]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok) Sep 27 10:45:01 proxy3 CROND[22209]: (root) CMD (/usr/local/squish/squishing.sh) Sep 27 10:50:01 proxy3 CROND[22283]: (root) CMD (/usr/lib64/sa/sa1 -S DISK 1 1) Sep 27 10:50:01 proxy3 CROND[22284]: (root) CMD (LANG=C LC_ALL=C /usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok) Sep 27 10:50:01 proxy3 CROND[22285]: (root) CMD (/usr/local/squish/squishing.sh)
- 09-28-2012 #9Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,696
But it is at least getting called by the cron daemon, right? At least per the log entry above.
Or are you saying that it does not appear to be getting called by the cron daemon at all?
Btw, your first cron entry is the one I believe is correct (the one specifying "root" user), although the other one may work on your system. Typically crontab wants that field to be a valid username.
In order to try and see what is going on, you can redirect the cron job output to a log. something like this:
then after 5 min, check the log in /tmp for output.Code:*/5 * * * * root /usr/local/squish/squishing.sh > /tmp/squish-cron.log 2>&1
- 09-28-2012 #10Just Joined!
- Join Date
- Sep 2012
- Posts
- 14
I did as u said
out put log :
I looked at squish.pl but didn't understand the problem of rrdsquish [Contd..2nd page]Code:find: `/var/squid/logs': No such file or directory find: `/usr/local/squid/var/logs': No such file or directory LOG: /var/log/squid/access.log Can't locate rrdsquish.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at /usr/local/squish/squish.pl line 25. BEGIN failed--compilation aborted at /usr/local/squish/squish.pl line 25.
Last edited by sureshk; 09-28-2012 at 10:00 AM. Reason: attached file on next page


2Likes
Reply With Quote

