[collectd] [PATCH] unixsock: remove a possible leftover unix socket file before creating

Peter Warasin peter at endian.com
Wed Mar 24 12:59:04 CET 2010


Hi guys

Sometimes when I restart collectd, it exits to slow and will be killed
by killproc... or sometimes it may be SIGKILL'ed too manually or other
motivations.

In that case, the socket file of the unixsock plugin, certainly will not
be removed.
The next start will then not create a new file and so afterwards that
socket communication is broken.

There was an unlink() of that socket file before bind(), but it is
commented out.
Re-introducing it (what the attached patch does) fixes the problem, at
least for me.

I wonder if there's a good reason why this has been commented out, and
if it can be unlink()'d safely, without side-effects?

regards,
peter

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

:: peter warasin
:: http://www.endian.com   :: peter at endian.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: collectd-4.9.1-unixsock-removeoldsocket.patch
Type: text/x-patch
Size: 799 bytes
Desc: not available
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20100324/af49e9e1/attachment.bin 


More information about the collectd mailing list