| 1 | {{{#!comment |
| 2 | Credit for the steps goes to: https://gist.github.com/j10io/6877030 |
| 3 | }}} |
| 4 | |
| 5 | Optionally create a new `deluge` user for running the service: http://support.apple.com/kb/PH6651 |
| 6 | |
| 7 | To create a `LaunchDaemon` for Deluge, create `/Library/LaunchDaemons/com.deluged.plist` using the script below. This script uses user 'deluge', created in the first step so replace if other user required. |
| 8 | |
| 9 | ''Note: The path to deluge assumes installation using Macports and will need modified if using `Deluge.app`.'' |
| 10 | |
| 11 | {{{ |
| 12 | <?xml version="1.0" encoding="UTF-8"?> |
| 13 | <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
| 14 | <plist version="1.0"> |
| 15 | <dict> |
| 16 | <key>Label</key> |
| 17 | <string>com.deluged</string> |
| 18 | <key>ProgramArguments</key> |
| 19 | <array> |
| 20 | <string>/opt/local/bin/deluged-2.7</string> |
| 21 | <string>-d</string> |
| 22 | </array> |
| 23 | <key>UserName</key> |
| 24 | <string>deluge</string> |
| 25 | <key>RunAtLoad</key> |
| 26 | <true/> |
| 27 | <key>KeepAlive</key> |
| 28 | <true/> |
| 29 | </dict> |
| 30 | </plist> |
| 31 | }}} |
| 32 | |
| 33 | |
| 34 | Set the service to load on startup: |
| 35 | |
| 36 | {{{ |
| 37 | sudo launchctl load -w /Library/LaunchDaemons/com.deluged.plist |
| 38 | }}} |
| 39 | |
| 40 | To start it immediately without reboot: |
| 41 | {{{ |
| 42 | sudo launchctl start com.deluged |
| 43 | }}} |
| 44 | |
| 45 | |