@ wrote... (7 years, 1 month ago)

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
Category: tech, Tags: osx
Comments: 6
Comments
1.
Ken @ May 8, 2012 wrote... (7 years ago)

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!

2.
Chuck @ January 8, 2013 wrote... (6 years, 4 months ago)

When running sickbeard to launchctl I get “Bad file descriptor” Is it because sickbeard is still running?

3.
Kurt Neufeld @ January 8, 2013 wrote... (6 years, 4 months ago)

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.

4.
Chuck @ January 8, 2013 wrote... (6 years, 4 months ago)

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?

5.
Kurt Neufeld @ January 8, 2013 wrote... (6 years, 4 months ago)

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.

6.
Kevin Ross @ October 13, 2016 wrote... (2 years, 7 months ago)

Thanks for this.

Here is a minor update to sabnzbd startup script that waits for a Volume to be mounted before starting (I use MountWatcher)

Click here to add a comment