How to tell when Squid has finished setting up disk cache directories?
At times we automatically start Squid from a clean setup. We run squid -z to create the cache directories and then start Squid for normal operation. The question is how to know when squid -z has finished and it is safe to start Squid for normal operation.
This is not a problem when one has one squid worker, one uses the -N (don't background) option as well and just waits for the process to finish.
However we want to use Squid with multiple workers and the problem is the -N option overrides the number of workers and it sets up only one cache directory. (Squid has one cache directory per worker.) If one does not wait then when Squid starts for normal operation the cache directories are not ready and it fails.
I am considering polling for the process with the PID written to the Squid pid file and when that exits assume all is OK, but this seems a bit clumsy. So I was wondering if anyone had any good ideas.
|