Re: Squid running check

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 6 Apr 2005 00:21:44 +0200 (CEST)

On Tue, 5 Apr 2005, Andrew Bartlett wrote:

> What Samba does on it's pid file is to check there is a fcntl() lock on
> the file. That way, we know that the process with that PID is also
> Samba, not a re-used PID.

Good idea. Except for the minor detail that it wastes one filedescriptor
to keep the lock file open.. Proposed patch attached implementing a fcntl
lock guarantee, but I am not entirely convinced this is worth wasting the
filedescriptor on.

Note: Squid does already verify that the pid really exists like Nickolay
proposed, not only that the pid file exists. See checkRunningPid(). The
attached patch is only to extend this with a guarnatee like described
above. There is however some broken third-party init scripts floating
around mismanaging both the pid files and their own service lock files.
The major Linux vendor is quite notable in shipping such broken init
scripts..

Regards
Henrik

Received on Tue Apr 05 2005 - 16:21:48 MDT

This archive was generated by hypermail pre-2.1.9 : Sun May 01 2005 - 12:00:06 MDT