[Csync2] csync2 not syncing symlinks?!

Lars Ellenberg lars.ellenberg at linbit.com
Thu Feb 21 17:47:34 CET 2008


On Thu, Feb 21, 2008 at 04:37:00PM +0100, Wolfram Schlich wrote:
> Hi Lars!
> 
> Thanks for your quick response.
> 
> * Lars Ellenberg <lars.ellenberg at linbit.com> [2008-02-21 15:58]:
> > On Thu, Feb 21, 2008 at 03:10:47PM +0100, Wolfram Schlich wrote:
> > > Hi,
> > > 
> > > it seems that csync2 is just not syncing symlinks.
> > > Is that true?
> > > If yes, why the heck...?! :)
> > > 
> > > Scenario:
> > > - /etc/csync2/csync2.cfg: include /usr/lib/something;
> > > - /usr/lib is a symlink to /usr/lib64
> > > - csync2 does not sync /usr/lib/something
> > > [...]
> > > When I change csync2.cfg to 'include /usr/lib64/something;',
> > > it *does* sync that file.
> > > 
> > > The observed behaviour really sucks... :(
> > > Are there plans to change this?
> > 
> > not at all.
> > works as designed.
> > of course it is syncing symlinks.
> > 
> > what you complain about is that it does not _follow_ symlinks,
> > when you configure them in your config file.
> 
> Hmmkay...
> 
> > well, the problem is, it cannot do both, sync symlinks and follow them
> > in the config file during directory traversal.
> > 
> > the intended behaviour is
> > 
> >     /etc/someconfig-file  is symlink to /etc/someconfig-file.version1
> > 
> > in csync2.cfg, there is
> >    include /etc/someconfig-file;
> >    (and, obviously, someconfig-file.version1, version2, version3)
> > 
> > you want to switch configs, you do change the symlink on one box,
> > and sync that change, and csync2 will let the symlink point to that
> > other file on all other boxes.
> > 
> > ln -sf /etc/someconfig-file.version2 /etc/someconfig-file
> > csync2 -xv /etc/someconfig-file
> 
> Well, I fail to understand why it shouldn't be *technically possible*
> to resolve paths with symlinked components during directory traversal.
> 
> When I tell it to sync /usr/symlink/foo, why should it not be able to
> follow /usr/symlink/foo to /usr/real/foo on the local side and sync
> that exact file to /usr/symlink/foo on the remote side, no matter whether,
> on the remote side, /usr/symlink exists as a symlink and whereever it
> points to or whether it exists at all (if it doesn't exist, just
> create it as a directory with the permissions of the symlink target on
> the local side)...
> Ok, that was just an idea, but probably not the sanest one.
> I see it's not easy to handle correctly or if it's reasonable to
> try it at all.

*technically possible* (in the sense of "theoretically") sure, anything.
but what about the additional complexity of
recursive symlinks?
symlink on one side, directory on an other and a file on the third?
removals when it is a symlink on A and a directory tree on B?
...?
and do all that _generically_ so it does not only work for the specific
corner case you happen to think of, but for every possible combination
of (mis)configuration?

what you basically ask for is the "do-what-I-mean" command.
good luck implementing it ;-)

> A big fat notice in the csync2.cfg documentation would be the minimum
> improvement though (and the documentation as a whole is... well, not
> optimal, to say the least :>).

well,
since you just now volunteered,
thanks for improving.

-- 
: Lars Ellenberg                            Tel +43-1-8178292-55 :
: LINBIT Information Technologies GmbH      Fax +43-1-8178292-82 :
: Vivenotgasse 48, A-1120 Vienna/Europe    http://www.linbit.com :


More information about the Csync2 mailing list