Page 1 of 1

Run SABnbd+ at startup (OSX)

Posted: April 16th, 2008, 7:19 pm
by s3ood
1. Create a plist using any program you like using the following code:
Note: make sure its plain text if your using TextEdit

Code: Select all

<?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.random.sabnzbd</string>
	<key>ProgramArguments</key>
	<array>
		<string>/Volumes/Files/SABnzbd/SABnzbd.py</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
Another note: make sure you change

Code: Select all

<string>/Volumes/Files/SABnzbd/SABnzbd.py</string>
to the location of your SABnbd.py

2. Save it as com.random.sabnzbd.plist to your desktop or where ever.
Note: Make sure there is no hidden .txt or any other ext when you save with TextEdit.

3. Open Terminal type:

Code: Select all

cp ~/Desktop/com.random.sabnzbd.plist ~/Library/LaunchAgents/
4. Restart/log off or just type the following command to start SABnbd+

Code: Select all

launchctl load -w ~/Library/LaunchAgents/com.random.sabnzbd.plist 
no more annoying terminal icon :D

Re: Run SABnbd+ at startup (OSX)

Posted: September 7th, 2008, 1:56 pm
by bpwats
Interesting way for automatic restart function:

Code: Select all

<?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>SuccessfulExit</key>
		<true/>
	</dict>
	<key>Label</key>
	<string>org.teamsabnzbd.sabnzbd</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/local/SABnzbd/SABnzbd.py</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
created using Property List Editor (part of developer tools)

The KeepAlive key restarts the program on clean exit. (Setting SuccessfulExit to false would restart it after crashing.) So either way, it needs RunAtLoad set to true.

Do not use

Code: Select all

<key>KeepAlive</key>
	<true/>
as in my experience it tries to start SABnzbd on system hold up => locking up your machine.

Bryan Wats
Running from sources on Mac OS X 10.5, DevTools 3.1