LINBIT / csync2

file synchronization tool using librsync and current state databases
GNU General Public License v2.0
145 stars 39 forks source link

Connection closed using xinetd #2

Closed corentingi closed 6 years ago

corentingi commented 6 years ago

System: Csync 2-2.0 Xinetd Ubuntu 16.04

http://lists.linbit.com/pipermail/csync2/2016-September/000051.html

We had the same issue recently and it took some time for us to debug this.

That would be (x)inetd mixing stderr of csync2 into stdout,
thereby "corrupting" the csync2 protocol.

add "-l" to the inetd invocation.  as in
/etc/inetd.conf:
-csync2          stream  tcp     nowait  root    /usr/sbin/csync2 csync2 -i
+csync2          stream  tcp     nowait  root    /usr/sbin/csync2 csync2 -i -l

xinetd: server_args = -i -l

This -l fixed everything, I'm writing this issue to acknowledge that 👍 Also the -l parameter is not described in the help. So I can't explain what it does exactly

lge commented 6 years ago

-l enables logging to syslog of messages that otherwise went to stderr, which unfortunately clobbers stdout when running under inetd, as apparently both point to the same socket fd there.

Since May 2016, 999f153 "fix for inetd stderr >& stdout", redirecting logs to syslog is the default when running in inetd mode.

Your csync2 is simply to old, complain to your distribution ;-)