9

I have recently installed plexmediaserver 64-bit from the plex site on my Kubuntu 15.04 laptop and am unable to start. I believe it is in the change from how init scripts work?

If you look at the guide for Plex it says to execute /etc/init.d/plexmediaserver start once you have installed it for the first time.

It appears that /etc/init.d/plexmediaserver is an invalid symlink or something?

Not sure where to go to help troubleshoot this...

jjesse
  • 1,117
  • 2
    It looks like Plex needs to be updated or fixed for systemd? https://forums.plex.tv/index.php/topic/152214-systemd-service-file-for-ubuntu-package/ – jjesse Mar 26 '15 at 20:41
  • That discussion was updated in May 2015 and now says that the Ubuntu plex package has been updated for systemd. – JdeBP May 09 '15 at 10:57

2 Answers2

12

Had the same issue on Ubuntu 15.04

Resolved it by creating a new file: /etc/systemd/system/plexmediaserver.service

Afterwards, pasted the following:

[Unit]
Description=Plex Media Server for Linux
After=network.target

[Service]
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=/var/lib/plexmediaserver/Library/Application Support"
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/plexmediaserver
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
ExecStartPre=/bin/sh -c '/usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"'
ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
Type=simple
User=plex
Group=plex
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

Then run, sudo service plexmediaserver start

Plex should start normally and you should be able to access it through: http://127.0.0.1:32400/web

Source

A.B.
  • 90,397
  • The /bin/sh -c wrapping in ExecStart is wholly unnecessary, and indeed a mismatch for Type=simple. – JdeBP May 03 '15 at 19:37
  • i did this and now i get : chris@mediaserver2:~$ sudo service plexmediaserver start Failed to start plexmediaserver.service: Unit plexmediaserver.service failed to load: Bad message. See system logs and 'systemctl status plexmediaserver.service' for details. – user218314 May 19 '15 at 13:04
  • @JdeBP I just verified that the change you suggest does not work. – Sukima Jun 13 '15 at 13:31
  • Not having a wholly unnecessary and mismatched extra shell process works just fine for many other people, including a lot of Arch Linux users it seems. You've botched it somehow. – JdeBP Jun 23 '15 at 16:47
1

The above script was already on my system and it still was not working. Upgrading to 0.9.12.4.1192 fixed all issues with systemd.

Drew
  • 370