# Sometimes squid won't start after server restart



## ccc (Dec 21, 2009)

hi

I have squid Version 2.7.STABLE6 installed from ports on my freeBSD 7.0:
	
	



```
# uname -a
FreeBSD bsd.dom 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
```
Sometimes squid won't start after machine restart and I don't know why.
I have already this line in /etc/rc.conf
	
	



```
squid_enable="YES"
```
Howto solve this problem?


----------



## SirDice (Dec 21, 2009)

Any hints in the log files?


----------



## ccc (Dec 21, 2009)

SirDice said:
			
		

> Any hints in the log files?



NO, I don't have any hints in the log.


----------



## DutchDaemon (Dec 21, 2009)

Not even in the cache.log file? Squid usually fails to start for only two reasons: 1) the cache dir is dirty and can't be cleaned, or 2) the squid.pid can't be overwritten. 

Usually cache.log complains about this quite loudly, and you may even catch Squid continually restarting itself.


----------



## orange (Dec 22, 2009)

Try adding rcshutdown_timeout="90" to /etc/rc.conf

I had the same issue after a reboot with squid. The above line will allow a service more time to shutdown correctly.


----------



## FryShadow (Dec 23, 2009)

I have the same problem, and I have to start it manually 

squid -D


----------



## DutchDaemon (Dec 23, 2009)

Note that 'auto-starting' Squid will not work when a background-fsck is running, because Squid will not start on a 'dirty' filesystem. I always turn off background-fsck on Squid servers. I'd rather wait a few minutes for it to finish and then have Squid start automatically.


----------

