To autostart the very excellent SickBeard and SABnzbd on OSX (Snow Leopard in my case) you need to create two plist files and then tell launchd to start them.
Note ~ means your home directory in Unix speak. And upper/lower case matters!
Edit the path to python, SickBeard, and SABnzbd as appropriate. In a terminal windows type which python to find out the path to python. Hopefully you know where you installed the apps.
Save as ~/Library/LaunchAgents/com.sickbeard.sickbeard.plist
<?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>Label</key> <string>com.sickbeard.sickbeard</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/python</string> <string>/Applications/SickBeard/SickBeard.py</string> <string>-q</string> <string>-d</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> |
Save as ~/Library/LaunchAgents/com.sabnzbd.SABnzbd.plist
<?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>Label</key> <string>com.sabnzbd.SABnzbd</string> <key>ProgramArguments</key> <array> <string>/usr/bin/open</string> <string>-a</string> <string>/Applications/SABnzbd.app</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> |
Save as ~/Library/LaunchAgents/com.couchpotato.couchpotato.plist
<?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>Label</key> <string>com.couchpotato.couchpotato</string> <key>ProgramArguments</key> <array> <string>/usr/local/bin/python</string> <string>/Applications/CouchPotato.app/CouchPotato.py</string> </array> <key>RunAtLoad</key> <true/> </dict> </plist> |
Make sure SickBeard, SABnzbd, CouchPotato are NOT running and then from a terminal window:
cd ~/Library/LaunchAgents launchctl load com.sickbeard.sickbeard.plist launchctl load com.sabnzbd.SABnzbd.plist launchctl load com.couchpotato.couchpotato.plist launchctl start com.sickbeard.sickbeard launchctl start com.sabnzbd.SABnzbd launchctl start com.couchpotato.couchpotato |
Your apps are now probably running, they certainly will be after your next reboot.
If you ever want to stop them from starting after login
cd ~/Library/LaunchAgents launchctl unload com.sickbeard.sickbeard.plist launchctl unload com.sabnzbd.SABnzbd.plist launchctl unload com.couchpotato.couchpotato.plist |
Perfect, wasn’t working right away as my python was in just usr/bin/ rather than local. Took me a moment to figure why SABnzbd was working but not the python calls
Thanks!
Comment by Ken — May 8, 2012 @ 11:07 pm
When running sickbeard to launchctl I get “Bad file desctriptor”
Is it because sickbeard is still running?
Comment by Chuck — January 8, 2013 @ 4:14 pm
If sickbeard is currently running you’ll likely have problems. Stop sickbeard, then try again.
Also, check to make sure where your python is. It’s for sure in /usr/bin but I installed Homebrew so I use that one.
Comment by Kurt Neufeld — January 8, 2013 @ 4:25 pm
I’ve stopped sickbeard from the menu and tried killing the process in terminal,
but I still get the “Bad file descriptor” error. Is there a way to stop sickbeard in
terminal?
Comment by Chuck — January 8, 2013 @ 4:48 pm
Use the ps command to see running processes. Use the grep command to filter. Use the ‘kill -9′ to stop a process with extreme prejudice.
$ ps auxw|grep -i sickbeard
kneufeld 40222 0.0 0.5 2614032 90928 s007 S+ Mon08am 0:52.58 /usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python ./SickBeard.py
$ kill -9 40222
You’ll need to show me all your output if you expect me to help you any further.
Comment by Kurt Neufeld — January 8, 2013 @ 4:54 pm