PDA

View Full Version : squid not stopping through rc script


myha
February 13th, 2009, 09:45
Hi guys,

I am having some problems with restarting the squid service through rc script...

[root@server ~]# /usr/local/etc/rc.d/squid stop
Stopping squid.
Waiting for PIDS: 857, 857, 857, 857, 857, 857, 857^C
[root@server ~]# /usr/local/etc/rc.d/squid stop
Stopping squid.
[root@server ~]#

as you can see it hangs for the first time, then I interrupt it with ctrl+c, do restart again and after that it works instantly....

Any idea?

vivek
February 13th, 2009, 09:49
It takes time to stop and restart. I've 100 of proxy user at any given time and if I had to stop it may take up to 2-5 minutes to clean out everything. So nothing is new here..

myha
February 13th, 2009, 09:51
Aha, ok, than thanks. I thought there was smth wrong, but you are right - if I wait longer it does restart...

hydra
February 13th, 2009, 11:02
If you just want to apply your newly configured settings, it's not necessary to stop/start squid, reload instead.

DutchDaemon
February 13th, 2009, 11:06
Or even the 'cleaner' squid -k reconfigure.

DutchDaemon
February 13th, 2009, 11:08
# TAG: shutdown_lifetime time-units
# When SIGTERM or SIGHUP is received, the cache is put into
# "shutdown pending" mode until all active sockets are closed.
# This value is the lifetime to set for all open descriptors
# during shutdown mode. Any active clients after this many
# seconds will receive a 'timeout' message.
#
#Default:
# shutdown_lifetime 30 seconds

hydra
February 13th, 2009, 11:53
Reload actually does squid -k reconfigure :)

DutchDaemon
February 13th, 2009, 12:20
Oh right, misread it as 'restart', sorry ;)

hydra
February 13th, 2009, 13:38
Let's have a coffee DutchDaemon, it has been a long week...

myha
February 13th, 2009, 14:15
Hi,

thanks for all the replies. I was aware of reconfigure command etc, but currently the server is in testing so I stop it manually also and it took quite some time.

myha
February 13th, 2009, 14:22
btw has anyone managed to make webalizer to work with squid correctly? It seems no matter which option/format I choose some field is missing in report... ?

this is the best so far, but the requested URLs are stripped - domain is missing in reports...:

squid.conf:
access_log /var/log/squid/webalizer/access.log combined
logformat combined %>a %ui %un [%tl] "%rm %ru HTTP/%rv" %Hs %<st "%{Referer}>h" "%{User-Agent}>h" %Ss:%Sh

webalizer:
LogType clf

DutchDaemon
February 13th, 2009, 16:56
You could try calamaris and sarg, which are written for Squid.

hydra
February 13th, 2009, 20:06
Among the free ones, I would surly recommend Sarg, it seems the best.

Mel_Flynn
February 13th, 2009, 21:49
Add this to /etc/rc.conf:

rcshutdown_timeout="90"


Since squid will take up the full 30 seconds of the default setting already, you will get watchdog_timeout messages and shutdown will abort running further shutdown scripts.
This may leave your data and worst case, disk in undesired state.

You may need to adjust this up pending the amount of time squid takes under production load.