PlexConnect as a daemon

I’m trying to get PlexConnect setup as a daemon. Following the instructions and the scripts provide, it works very well… almost.

I’m trying to get Plex Media Server and PlexConnect to play nice together on the same machine. If I start everything manually, it works fine. But I am trying to automate so if the machine (basically my media server) get rebooted for any reason, everything restarts automatically.

For PMS, the only option is to put it in the user’s login items. I have been doing that for years with no issues. And after the user is logged in and PMS is started, starting PlexConnect from the command line in Terminal works just fine. The issue is running it as a daemon. Using the scripts provided with PlexConnect it does work, however, it is setup to run when the machine boots and at that time, PMS isn’t running because the user isn’t logged in so I get an error.

I have other things that get started at login for this users (CouchPotato, SickRage, Headphones) and I have a shell script for those and put the scripts in the user login items. This works well for me. I could do that for PlexConnect except it seems to only launch properly if I use sudo, and since that will require a password, that defeats the point of an unintended restart of everything.

Has anyone done this? What am I missing?

Thanks.

The official method for OS X is here:

Otherwise you can use the unofficial method using the OpenPlex:

https://forums.plex.tv/discussion/108332/openplex-os-x-app#latest

*Only works on 10.6.x+ on 64-bit systems.

The official method for OS X is here:

Install Guide Mac · iBaa/PlexConnect Wiki · GitHub

Yes. This is what I did but it was loading before PMS and couldn’t because PMS hadn’t started yet

Otherwise you can use the unofficial method using the OpenPlex:

https://forums.plex.tv/discussion/108332/openplex-os-x-app#latest

*Only works on 10.6.x+ on 64-bit systems.
Thanks. I saw references to this in my searching but obviously didn’t check it out. I’ll give it a look.

You should be able to start PlexConnect before PMS starts without any issues besides your local PMS content of course. Personally I have my automatic login enabled set to my user and a plist that runs behind the scenes to load all my apps @ boot to ensure PMS, iTunes (home sharing), etc are started while still locking my screen so I don’t have to goto my mac whatsoever if it reboots. The button to enable this is boot lock in the extras tab of OpenPlex but you still must enable automatic login manually via login items in the users & groups button in the System Preferences.app for OS X.

Thanks. I do have automatic login turned on and have been using Login Items for that user. I put PMS and other .app files in there, then I created shell scripts for the other things (SickRage, etc). All was working well but when I added PlexConnect to the mix and set it up as a daemon the official way, I got an error saying it couldn’t start because PMS wasn’t there (or something, I need to try again).

So are you saying I can do all of this (SABnzbd, PMS, SickRage, etc) from OpenPlex? I would much prefer it done behind the scenes with plists as you mention but haven’t gotten far enough to work on that and figure it out.

The plist installed from OpenPlex will start your mac up as if you logged into it then locked the screen. All the apps/scripts still load in the background. Its pretty simple from OpenPlex, just click boot lock button and thats it. The plist is installed for you and everything should be ready assuming the automatic login is set.

I’ve been playing but having issues. I have it installed and I can get to PlexConnect from my aTV. I am hijacking iMovie and when I select it, I can see playlists, channels, etc. BUT, if I select Library, it shows “Accessing iMovie Theater” and just spins. Looking at the log I see this:

18:52:40 PlexAPI: No Response from Plex Media Server
18:52:40 PlexAPI: We failed to reach a server. Reason: Unauthorized
18:52:40 PlexAPI: Traceback:
Traceback (most recent call last):
File “/Applications/PlexConnect/PlexAPI.py”, line 378, in getXMLFromPMS
response = urllib2.urlopen(request, timeout=20)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 437, in open
response = meth(req, response)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 550, in http_response
‘http’, request, response, code, msg, hdrs)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 475, in error
return self._call_chain(*args)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 409, in _call_chain
result = func(*args)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py”, line 558, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized

Seems odd that I would get an unauthorized when it shows me everything else. Any ideas?

Sign out of myplex on your PMS or remove yourself from the plex home and it should work. You can also goto the settings tab and just sign into myplex and fix it that way also if it ever reaches it. I seen a similar issue when I lose internet and am still in a plex home.

It’s really weird. On the aTV, I can go to Playlists, select one, select a movie and play it with no problem. Channels are there as well. But if I try to go to Library, it just spins and the log shows not authorized. Why would it let me get to things other ways but not through Library?

I seen this issue also when not signed into myplex on the aTV when being in a plex home. Sign into myplex in the settings tab and it should work. I opened a topic about but only heard crickets:

https://forums.plex.tv/discussion/181956/plex-home-pms-myplex-bug-s#latest

PMS is signed into MyPlex and PMS is setup as Plex Home with several accounts. The aTV is signed into MyPlex but Home User is off. When the aTV isn’t signed into MyPlex, it tells me it has no content.

Same here:

https://forums.plex.tv/discussion/181956/plex-home-pms-myplex-bug-s#latest