[collectd] [PATCH] unixsock: handle stale socket file

Peter Warasin peter at endian.com
Mon Apr 12 21:55:46 CEST 2010


Hi Sebastian

>>>> At the very least (imho), we should check if that file is a UNIX socket,
>>>> and possibly (I'm not sure if that's possible [in a portable way]) check
>>>> if the socket is not in use. If both of that is the case, we can be
>>>> fairly sure that removing the file is safe.
>>> Ok, i understand. That makes sense.
>> Are you willing to give that a try and provide a patch?
> 
> Sure..
> 
> The attached patch handles stale socket files and removes only if it is
> a socket and it is not possible to connect() to it. Code is borrowed
> from clamav :)

Any comments on the patch?
Do you want me to change something?


peter

-- 
:: e n d i a n
:: open source - open minds

:: peter warasin
:: http://www.endian.com   :: peter at endian.com



More information about the collectd mailing list