From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322) Description of problem: If the master squid process crashes, is not shut down correctly, or is shut down using 'squid -k shutdown', the .pid file can be left intact, causing the init script to fail when an attempt is made to restart squid. This is because the presence of the .pid file indicates to the script that squid is still running, when in fact it might not be. Ideally the script needs to check for the presence of squid processes (perhaps using 'ps') and if squid is listed as a running process do not attempt to start a second copy. Relying on the .pid file is at best a hack and is not particularly reliable... Version-Release number of selected component (if applicable): 2.5STABLE3 How reproducible: Always Steps to Reproduce: 1. Start squid 2. Shut squid down manually, or have the master process crash and die 3. Attempt to restart squid Actual Results: Squid shuts down leaving a .pid file behind, creating problems when squid is restarted with the init script as it believes squid is already running Expected Results: Squid should be able to be started and the pid file get overwritten Additional info:
An easy way to do this may be to test for the presence of the squid.pid file in the start() routine, and if it does exist, run: kill -0 `cat /var/run/squid.pid` Test for a return code, if no return code then squid is still really running and an error should be reported back. If something like 'kill - no such process' is returned, then the pid file needs to be deleted and/or overwritten as it is stale, and squid should be started.
This seems to work fine in rawhide--after stopping squid with either squid -k shutdown or kill -9 "service squid start" started it without a problem.
Ditto, seems to be ok now. I'm happy for this to stay closed.