Comment 1 for bug 1073478

Revision history for this message
Robie Basak (racb) wrote : Re: squid3 does not clean up pid file

Thank you for taking the time to report this bug and helping to make Ubuntu better.

I can confirm that the logrotate test fails if squid is not running, and agree that this is a bug.

Unfortunately I can't find a good reference to point to in order to declare that squid should be cleaning its pid file and that it is not, although my understand has also always been that daemons should do this when they can. I've found http://stackoverflow.com/questions/688343/reference-for-proper-handling-of-pid-file-on-unix and http://perfec.to/stalepid.html both of which indicate that it is a good thing to do, but there doesn't seem to be any definitive reference for this.

I think an easier fix would be to adjust squid's logrotate configuration to test for the process before calling "squid3 -k rotate".

Could you try this as a workaround? In /etc/logrotate.d/squid3, replace the postrotate line:

    test ! -e /var/run/squid3.pid || /usr/sbin/squid3 -k rotate

with:

    test ! -e /var/run/squid3.pid || ! kill -0 `cat /var/run/squid3.pid` 2>/dev/null || /usr/sbin/squid3 -k rotate