Skip to content

Instantly share code, notes, and snippets.

@XxUnkn0wnxX
Last active February 17, 2021 15:25
Show Gist options
  • Save XxUnkn0wnxX/9f260a476472b9cb43afecc30f0c2a93 to your computer and use it in GitHub Desktop.
Save XxUnkn0wnxX/9f260a476472b9cb43afecc30f0c2a93 to your computer and use it in GitHub Desktop.
SickChill LaunchAgent macOS [Runs On Boot]
<?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>Disabled</key>
<false/>
<key>Label</key>
<string>Paths</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
<string>launchctl setenv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</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>Disabled</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>SickChill</string>
<key>ProcessType</key>
<string>Interactive</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/python2</string>
<string>REPLACE TEXT</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@XxUnkn0wnxX
Copy link
Author

XxUnkn0wnxX commented Jun 24, 2018

make sure in /etc/paths your paths looks like this:
/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin

with /usr/local/bin <-- at the top

"Paths.plist" should also go YourHomeFolder/Library/LaunchAgents
this all ensures that that brewed versions of the repositories run 1st before any app like SC or SAB uses the system defaults repos from /usr/bin.

SickChill.plist
I found a better way to running SC other then the previous method. this relies on using the built in launchd in Mac to Daemonize SC

make sure that you are using brewed version of python
brew install python@2
brew link python@2 --force

Use Python3
brew install python@3.8
brew link python@3.8 --force

Where "REPLCE TEXT"
Replace with Full path to "SickBeard.py"
do not include "-d &" at the end nothing comes after "SickBeard.py"

and please don't have spaces within your folder names to reduce margin for error.

Launch SickChill On Boot & Via App <-- use this for reference if required.

save as SickChill.plist via a text editor into ~/Library/LaunchAgents (your user Library not system)

to launch right away just type launchctl load PathToSickChill.plist in terminal, or drag and stop the .plist file from the LaunchAgents folder after "launchctl load " - make sure there is space before you drag and drop. then hit enter.

note: with this SC will run at boot & the "KeepAlive" will keep it running no matter what even if you update via the GUI or restart it, launchd will start it back up. unless you unload it manually via terminal. but will start up again on boot or via manual load.

also when you update SickChill or python@2 manually via git/brew be sure to launchctl unload PathToSickChill.plist & Reload after updating.

be sure "only shutdown when restarting SC" option is enabled with SC config.

@XxUnkn0wnxX
Copy link
Author

XxUnkn0wnxX commented Jun 24, 2018

I also use http://www.soma-zone.com/LaunchControl/ to help manage custom Launch Daemons + can easily make new ones on the fly, it is some what free but not all capability's are avalable on free mode, a paid licence is required to use the full program, there maybe other free GUI apps that help to manage, edit & create Launch Daemons/Agents.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment