[Csync2] [patch] fix build on FreeBSD and Ubuntu 10.04

Andrey Zonov andrey at zonov.org
Sat Oct 29 15:47:14 CEST 2011


28.10.2011 12:56, Lars Ellenberg wrote:
> On Thu, Oct 27, 2011 at 07:08:18PM +0400, Andrey Zonov wrote:
>> Hi,
>>
>> I've got a few patches which fixes configuring and building csync2 from git.
>>
>> Under Ubuntu 10.04 should be fixed configure.ac around checking gnutls [1]
>>
>> Under FreeBSD need some more patches:
>>    * Fix shebang in autogen.sh [2]
>>    * FreeBSD 8 already has strlcpy(3), so fix it [3]
>>    * Use one equal sign instead of double, to be more compatible with POSIX
>> Bourne Shell [4]
>>
>> Platform independent:
>>    * Close listen socket in child. [5]
>>    * Use IPv4 for listen socket [6]. That's because of new systems already
>> has IPv6 support and may have only link-local addresses and aren't be
>> connected to the Internet or even local network via IPv6. So pretty fix is
>> create more than one listen socket.
>> [1] patch-ubuntu-configure.ac
> ok.
>
>> [2] patch-autogen.sh
> s/bash/sh/ ...
> Why? But anyways, I don't care either way ;-)

Because /bin/sh there's on every UNIX-like machine, but /bin/bash - not.

>> [3] patch-strlcpy-configure.ac-rsync.c
> ok.
>
>> [4] patch-posix-shell-configure.ac
> Yeah, see above. Ok.
>
>> [5] patch-close-listen-csync2.c
> ok.
> just because it is correct that way,
> or does it actually fix something?

That fix self restart in stand-alone mode.
After killing parent from "action" section it's not possible to start 
new one, because child from which should start new daemon still listen 
socket.

>> [6] patch-use-ipv4-csync2.c
> If you want, you can add a "-4" or "-6" option.
>
> But patching it to only allow IPv4 is certainly the wrong approach.
> Actually, I think, the bind loop there should even prefer AF_INET6,
> as sockets bound to :::xyz are reachable by IPv4 as well as IPv6
> (at least on linux...).
>
> So, no, [6] is rejected.

As far as I know for that trick must be run FAITH daemon.
Anyway, what do you think about listening on all possible sockets that 
returned by getaddrinfo(3) and blocks on select(2) instead of accept(2)?

>> -- 
>> Andrey Zonov
> Thanks for the effort, and for feeding it back upstream.  Will commit
> that soon, I have some other build fixes pending in my checkout that I
> still need to commit, too...
>
> 	Lars

Thanks!

-- 
Andrey Zonov



More information about the Csync2 mailing list