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 :: [email protected]
Remove a possible leftover unix socket file before creating
If there is an old unix socket file left within filesystem,
it will not be overwritten with a new one, so no socket
communication is possible.
---
src/unixsock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: collectd-4.9.1/src/unixsock.c
===================================================================
--- collectd-4.9.1.orig/src/unixsock.c 2010-03-24 12:28:25.000000000 +0100
+++ collectd-4.9.1/src/unixsock.c 2010-03-24 12:28:30.000000000 +0100
@@ -89,7 +89,7 @@
sa.sun_family = AF_UNIX;
sstrncpy (sa.sun_path, (sock_file != NULL) ? sock_file : US_DEFAULT_PATH,
sizeof (sa.sun_path));
- /* unlink (sa.sun_path); */
+ unlink (sa.sun_path);
DEBUG ("unixsock plugin: socket path = %s", sa.sun_path);
_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd