Linux (Ubuntu 15.04) help - need SystemD start up file for PlexConnect

Hi All,

I’m trying to get PlexConnect to launch automatically at system boot under Linux (Ubuntu 15.04 Server).

Conscious they have moved to SystemD now instead of Upstart etc.

Does anyone have a SystemD (preferably Ubuntu) start up file that they can share to help me out as I’m guessing in the dark and failing at the moment!

Cheers, Simmo

Managed to find one from a friend which works a treat. Here it is just in case anyone else has a similar issue:

[Unit]
Description=PlexConnect for Linux
After=network.target plexmediaservice.target
Wants=plexmediaservice.target

[Service]
WorkingDirectory=/usr/local/lib/PlexConnect
ExecStart=/usr/bin/python /usr/local/lib/PlexConnect/PlexConnect.py
Type=simple

[Install]
WantedBy=multi-user.target

How did you get this to work? I’ve been trying everything to get mine to work and haven’t. Is this the plexconnect.conf?

It took ages to figure out!

Ubuntu 15.04 uses a thing called SystemD to start services on boot, the older versions use Upstart. You can get the system to switch over but by default, SystemD is the method to get things to launch on boot for 15.04.

See this webpage for a news write up of the moved to SystemD: theregister.co.uk/2015/03/07/ubuntu_to_switch_to_systemd/

It’s not the plexconnect.conf file, I couldn’t get that to work at all. I read up on SystemD and how things moved over from Upstart (this web page: wiki.ubuntu.com/SystemdForUpstartUsers ) and then spoke to a friend who is a Linux developer who pointed me in the right direction.

Basically I created the above content in a file /etc/systemd/system/plexconnect.service (you’ll need to update the files/folders in the file to where you have PlexConnect installed), I used sudo to launch vi to create the file, didn’t bother with permissions as they seemed to be fine on creation.

then ran:
systemctl enable plexconnect.service
This enables it as a system service and tells it to start on next boot.

I then ran:
systemctl start plexconnect.service
This starts PlexConnect as a service. Note, I had previously killed off the PlexConnect processess that were running (I ran ps -ef | grep Plex to find out what they were and then sudo kill xxx where xxx is the process numbers - there were 4 of them).

You can also check the status of the service (whether its failed etc) using:
systemctl status plexconnect.service

It would be great if the devs of PlexConnect were able to write some scripts to do this automatically based on system type. PMS sort of does this when you dpkg install it, so maybe the scripts could be borrowed from there.

Hope that helps

Cheers, Simmo

Heres my plexconnect.service file, note I had to rename it to plexconnect.service.txt to get the forum to allow the update so youll need to rename it back.

Cheers

Just to confirm for anyone searching, this seems to work for CentOS7 too. :slight_smile: