Created
February 9, 2015 05:28
-
-
Save tjluoma/62e7fb663e9c9da207b5 to your computer and use it in GitHub Desktop.
launchd plist to launch BitTorrent Sync and keep it running, even if it crashes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>KeepAlive</key> | |
<dict> | |
<key>Crashed</key> | |
<true/> | |
<key>SuccessfulExit</key> | |
<false/> | |
</dict> | |
<key>Label</key> | |
<string>sync.com.tjluoma.bittorrentsync</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/open</string> | |
<string>-W</string> | |
<string>-a</string> | |
<string>BitTorrent Sync</string> | |
</array> | |
<key>RunAtLoad</key> | |
<true/> | |
</dict> | |
</plist> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't work as intended, because it relies on
/usr/bin/open
to launch BitTorrent Sync. Because of that, launchd will only re-launch the app if/usr/bin/open
returns error status when the app crashes. But it returns 0 in that case, so on an app crash, launchd still sees a successful exit. A working version would have to launch BitTorrent Sync directly so as to pick up its crash status. I uploaded one version of this at https://gist.github.com/atomicbird/ff2de46a594cdb5c8e69