Re: Squid running check

From: Nikcolay Pelov <nicksoft@dont-contact.us>
Date: Tue, 05 Apr 2005 13:44:09 +0300

Andrew Bartlett wrote:

>On Mon, 2005-03-14 at 18:00 +0100, Nickolay Pelov wrote:
>
>
>>I noticed that squid checks if it is running by checking if pid file
>>exists. I think it will be better to check if there is really process
>>with that pid like:
>>
>>if(kill(pid,0)==0){//squid is running
>>
>>}else{ // no process
>> //unlink the pid file
>>}
>>
>>I don't know how kill is implemented in other operating systems but I'm
>>sure that there is a way to check if process is running.
>>
>>
>
>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.
>
>Andrew Bartlett
>
>
>
Yes, but in some cases when squid is killed forcibly for some reason
the pid file stays and squid doesn't start.
For example if power is lost pid file stays and when server is back
squid don't start and many people don't
have internet connection.
Received on Tue Apr 05 2005 - 04:44:45 MDT

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