2

I have a Mac computer and would like to send backups to a Synology NAS.

Apple has rSync 2.6.9 pre-loaded with the operating system.

I installed rSync 3.1.3 using HomeBrew as Synology Active Backup requires at least 3.0. HomeBrew installed rSync into /usr/local/bin/rsync.

The problem is when I connect to the Mac computer using rSync, the Mac uses version 2.6.9 instead of the new one I installed. How can I make it so that it uses the new one instead of the old one?

I know about changing the PATH for the local user to put /usr/local/bin/rsync before /usr/bin/rsync. It works when I am logged in using the terminal or SSH. However, when I connect using Synology, it always invokes 2.6.9 which renders it not workable.

Is there anything in there that can cause the system to use 3.1.3 in the /usr/local/bin/rsync instead of the original one that came with the computer?

Thanks in advance.

  • Hi. What OS reaches out to macOS and initiates the rsync? I think the launchd that’s receiving the inbound ssh connection spawns the default rsync and not your newer one, but I wanted to be sure what port is arriving at the mac from Synology – bmike Jun 13 at 3:01
  • Synology Active Backup uses rSync to reach out to MacOS. Basically, the Synology NAS uses --protect-args which is not available in sub 3.0 version of rSync. How can I make it so that launchd and the ssh connection spawns the new version of rSync? – user1709730 Jun 13 at 3:42
  • Looks like a cross-site dup of superuser: Trouble negotiating rsync protocol versions. Summary: add --rsync-path=/usr/local/bin/rsync. – Gordon Davisson Jun 13 at 6:31
  • OK - I will try to dig up a proper answer to change launchd - @GordonDavisson Excellent reference for being able to craft the arguments from Synology to specify a path to rsync on the receiving end of the call. – bmike Jun 13 at 12:04
2

The answer depends on how you have setup ActiveBackup, as you can run it in three different ways:

1) Rsync shell mode via SSH

2) Rsync module mode (directly)

3) Rsync module mode via SSH

When using mode 1, ActiveBackup will login to the Mac and start up rsync itself. This does not go through launchd at all. I can see that you have been advised to use "--rsync-path", but that is not an option for you, simply because ActiveBackup does not let you set this parameter.

Instead what you need to do is to ensure that when ActiveBackup starts rsync on the remote server, it will start up the correct version - WITHOUT the possibility of changing which command ActiveBackup sends over. There's two ways of doing this depending on whether your ActiveBackup version is the one that issues the "rsync" command or the one issuing the "/usr/bin/rsync" command.

If it is the first one (try this first), then edit the /private/etc/paths file and make sure the "/usr/local/bin" line comes before the "/usr/bin" line.

If it is the second one, then use these steps:

  1. Reboot the Mac in Recovery Mode

  2. Open Terminal and disable SIP: "csrutil disable"

  3. Reboot and open Terminal

  4. Move away old rsync: "mv /usr/bin/rsync /usr/bin/rsync.orig"

  5. Link in new rsync: "ln -s /usr/local/bin/rsync /usr/bin/rsync"

You'll want to test this with ActiveBackup, and then reboot into Recovery Mode to enable SIP again with "csrutil enable".

Note that a subsequent macOS update might replace rsync. If that happens, just repeat the process. Note that as Apple hasn't updated rsync for years, it is not that likely to happen.

If you're using mode 2, ActiveBackup communicates directly with the rsync daemon, and does not start the rsync command itself on the Mac. In this case you cannot use the advise of using "--rsync-path", as it doesn't apply here at all. How to fix it depends on how you have actually started the rsync daemon. As you haven't detailed anything about starting it, I assume this means that you haven't actually started it.

However if you did follow a guide to enable rsyncd - you have probably done it through adding a launchd "LaunchDaemon". In that case you'll need to change your launch daemon file and find the key "Program" and change the corresponding string element to:

/usr/local/bin/rsync

If you're using mode 3, you'll want to follow the guide for mode 1 as it is the same steps necessary.

  • @GordonDavisson The steps to turn SIP back on are already in the answer - it is listed just below step 5. – jksoegaard Jun 13 at 18:32
  • Oops, I missed that. I'll remove my comment. – Gordon Davisson Jun 13 at 18:38
  • I am trying to avoid moving away the old rSync as it may not be a permanent solution and I do not know what other consequences are present. So far, it looks like mode 2 is the best option as it does not require me to do so. The question is, do you know of a reliable guide I can follow to enable rsyncd? – user1709730 Jun 13 at 19:06
  • I really doubt that there should be any negative consequences at all from replacing the old rsync. – jksoegaard Jun 13 at 19:59
  • I just tried editing /private/etc/paths file and it appears that /usr/local/bin already comes before /usr/bin. The other option will require put the Mac in recovery mode to disable SIP. This is only going to be a difficult one as I am not onsite. Is there a way to make the modifications remotely? – user1709730 Jun 14 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .