When running rsync on a directory that is meant to be a chroot, rsync will currently not correctly resolve symlinks with absolute targets because obviously, those targets are meant to be interpreted from inside the chroot.
Because of that, copy-unsafe-links and safe-links cannot be used properly in those cases.
It would be nice if there was an option to make the rsync client "chroot aware".
One potential solution:
rsync -aiv --rsync-path="chroot /chroot-path /usr/bin/rsync" src localhost:/dest
That does require you to have a working rsync inside the chroot, while a --chroot option would not.
If you don't have working ssh to localhost (or don't want to bother with localhost encryption), add "-e lsh" to the command and put the "lsh" shell script from the support dir on your path. Make sure it is a recent copy, like this one:
If you want to make use of lsh's user options, you should instead put lsh into the chroot (along with rsync) and do this:
rsync -aive "chroot /chroot-path /usr/local/bin/lsh" src user@localhost:/dest
I'm leaving this bug marked as an enhancement in case we want to add a --chroot option that makes it do a chroot internally.