# squid not stopping through rc script



## myha (Feb 13, 2009)

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[B]^C[/B]
[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 (Feb 13, 2009)

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 (Feb 13, 2009)

Aha, ok, than thanks. I thought there was smth wrong, but you are right - if I wait longer it does restart...


----------



## hydra (Feb 13, 2009)

If you just want to apply your newly configured settings, it's not necessary to stop/start squid, reload instead.


----------



## DutchDaemon (Feb 13, 2009)

Or even the 'cleaner' *squid -k reconfigure*.


----------



## DutchDaemon (Feb 13, 2009)

```
#  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 (Feb 13, 2009)

Reload actually does squid -k reconfigure


----------



## DutchDaemon (Feb 13, 2009)

Oh right, misread it as 'restart', sorry


----------



## hydra (Feb 13, 2009)

Let's have a coffee DutchDaemon, it has been a long week...


----------



## myha (Feb 13, 2009)

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 (Feb 13, 2009)

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 (Feb 13, 2009)

You could try calamaris and sarg, which are written for Squid.


----------



## hydra (Feb 13, 2009)

Among the free ones, I would surly recommend Sarg, it seems the best.


----------



## Mel_Flynn (Feb 13, 2009)

*Tip*

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.


----------

