Newsroom Update

Beginning in May, a special Today at Apple series titled “Made for Business” will offer small business owners and entrepreneurs free opportunities to learn how Apple products and services can support their growth and success. Learn more >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Updated launchctl plist for running rsync server daemon

I wanted to update the community on my launchctl plist for running rsync as a daemon. This is an update to this thread:

rsyncd plist for launchd -- not starting properly on reboot.

Here is my current plist in /Library/LaunchDaemons


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>Disabled</key>

<false/>

<key>KeepAlive</key>

<dict/>

<key>Label</key>

<string>rsync</string>

<key>ProgramArguments</key>

<array>

<string>/usr/local/bin/rsync</string>

<string>--daemon</string>

<string>--no-detach</string>

<string>--config=/Users/jabraham/RSync/rsyncd.conf</string>

</array>

<key>RunAtLoad</key>

<true/>

<key>StandardErrorPath</key>

<string>/Users/jabraham/RSync/stderr.txt</string>

<key>StandardOutPath</key>

<string>/Users/jabraham/RSync/stdout.txt</string>

</dict>

</plist>

A couple of important points:

* the --no-detach argument is important. Launchctl is responsible for keeping daemons running, so you don't want to use rsync's own facility to spawn a new daemon in the background. I didn't have this argument before, and it worked for me with Mavericks, but with Yosemite I needed the --no-detach

* I'm using a recent rsync from Homebrew, the much-too-old one bundled with Yosemite didn't work with my hard links properly (I can't actually remember what the actual problem was, maybe it didn't report an existing hard linking error properly, I was trying to hardlink on a file system that didn't support it.) The Homebrew one is in /usr/local/bin. If you don't have rsync from Homebrew or Macports the default one is version 2.6.9 and it's in /usr/bin

* I used LaunchControl from http://www.soma-zone.com/ I recommend it to setup options and to debug your typos and problems in launch daemons.

Posted on Apr 19, 2015 9:05 PM

Reply
Question marked as Best reply

Posted on Nov 11, 2015 9:19 AM

Shouldn't this:

<key>KeepAlive</key>

<dict/>

be

<key>KeepAlive</key>

<true/>

?

1 reply

Updated launchctl plist for running rsync server daemon

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.