Home › Linux
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!
Ubuntu moved to systemd - no .service and unable to start
I did a dist-upgrade and as planned Ubuntu moved its init daemon on 15.04 from upstart to systemd. Anyway, now plex won't start and I'm pretty sure it's because there isn't a .service for systemctl to start:
george@leviathan:~$ ls /lib/systemd/system/ | grep pl plymouth-halt.service plymouth-kexec.service plymouth-poweroff.service plymouth-quit.service plymouth-quit-wait.service plymouth-read-write.service plymouth-reboot.service plymouth-start.service plymouth-switch-root.service systemd-ask-password-plymouth.path systemd-ask-password-plymouth.service wpa_supplicant.service
I am unsure whether this is a plex problem or an ubuntu update problem, the script is still in init.d:
george@leviathan:~$ ls /etc/init.d/ | grep plex plexmediaserver
As I usually use Gentoo and believe that systemd should eat **** and die I have no clue how it works so I can't really fix it, sorry.
0
Comments
Ok, figured out from the init script in another thread I just had to manually do
It's quite useful actually for seeing what isn't being added to the library. You might want to add this to suggestions...
So you're on a pre-release version?
I am. 15.04 Vivid Vervet. Testing for problems like this is the whole point
The Monday update switched the init system from upstart to systemd
only once the apps themselves are systemd enabled, until then all you are testing is your ability to manually hack stuff together.
Strange, I switched to systemd a while ago (because 14.10 had a NFS mounting bug with upstart) and had no problems. Everything was aparently adapted automaticly because my plex service started automaticly and even after updates it works just fine. I just did the switch by doing an apt-get install systemd (which uninstalled upstart by itself).
So strange that it aparently doesn't work, if you do the update to 15.04 (or do a fresh install, whatever you did.)
Edit:
But it might aswell be, that Webmin did something in the background I was not aware of. All I know is, that it works... But anyway, now that ubuntu is changing to systemd it's just a matter of time before the Plex client also supports systemd. I mean they could for example just implement a script in the installer, which checks if systemd or upstart is installed (as you can/should not have both installed at the same time.)
Sorry, could you explain for me a little further? I'm in the same situation and still can't figure it out.
Open a terminal and type
What the problem is is that the script to start PMS at boot isn't converted to a systemd script when upstart is removed and systemd-sysv is installed. The above command starts PMS manually so you can go to http://localhost:32400/and configure your server. Until Plex add a systemd script to their Ubuntu installation then this will continue to happen.
I'm sure the way systemd is taking over Linux it's only a matter of time until Plex is actually part of it...
Hi,
as pointed out by UrbanLegend (https://forums.plex.tv/topic/152214-systemd-service-file-for-ubuntu-package/),
I just took the service file from the Fedora rpm:
# vi /etc/systemd/system/plexmediaserver.service
I had to change the group to 'nogroup'
plex:x:114:65534::/var/lib/plexmediaserver:/bin/bash
nogroup:x:65534:
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_SU
PPORT_DIR}"'
ExecStart=/bin/sh -c '/usr/lib/plexmediaserver/Plex\ Media\ Server'
Type=simple
User=plex
Group=nogroup
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
I tried the above idea (creating the service file) but on running systemctl I got the error:
Any ideas?
UPDATE:
Turns out that the plexmediaserver symlink is causing that error. So, after you've saved the service file do:
then:
Start Plex with:
Voila!
Yesterday I did the update to Ubuntu 15.04 and after that Plex server refuses to start.
I receive messages that Can not connect to Upstart when trying to start manually.
I will try the suggestions in this thread and report back.
PMS: Ubuntu Server 15.04 on P4 3.2GHz 4GB
Plex Client for Samsung on UE46D6200
Plex for Android: Galaxy S2 (CM12.1), Asus Transformer Prime TF201 (KatKiss 5.1.1), and SoftwinerEvb (stock 4.1.1)
Google Chromecast
Would like a native Sailfish version of Plex for my Jolla
An easy solution I found was to run "start_pms" in a terminal. Just add it as a startup task, and Plex will start running when you log in, which isn't too different from a service.
Finding Information,
Passing it Along
Ok, I did the upgrade to 15.04 and the PMS service now doesn't start. I get the upstart/systemd thing, so I running "/usr/sbin/start_pms &" at the terminal gets me up and running, for now. I'll read and figure out how to make this automatic and permanent later... or wait for Plex to fix their script.
However, since the upgrade I have lost all my channels and media libraries in PMS.
Forgive me, I know this question doesn't belong in this thread, but it's slightly annoying (and yes it's probably Ubuntu's problem, not Plex), but should this happen and can I restore my previous preferences without having to set everything up again?
Cheers :wacko:
If possible try using sysvinit, by appending this to the boot params:-
init=/sbin/sysvinit then reboot.
then plex server can be run by using this command:-
sudo /etc/init.d/plexmediaserver start
and stopped using this command:-
sudo /etc/init.d/plexmediaserver stop
Otherwise using systemd plex server would have to be switched to systemctl by using:-
service plexmediaserver start/stop/status
I forget,,,,if you're using sysvinit, then plex server can be added to the autorun on boot, by running (as root) chkconfig -a plexmediaserver which will autorun at boot on both runlevel 3 and 5, but to do this, run plex server first, like this:-
I just ran into this, and none of the suggestions in this thread worked. This reddit comment worked perfectly, however.
http://www.reddit.com/r/linux/comments/2y4pwm/ubuntu_to_switch_to_systemd_next_monday_brace_for/cp75472
Creating the file as suggested by freelancr (same as rodalphio links to) with the update from ronnietucker made the server kick back with all libraries intact. Hopefully Plex will bring an update shortly fixing this.
PMS: Ubuntu Server 15.04 on P4 3.2GHz 4GB
Plex Client for Samsung on UE46D6200
Plex for Android: Galaxy S2 (CM12.1), Asus Transformer Prime TF201 (KatKiss 5.1.1), and SoftwinerEvb (stock 4.1.1)
Google Chromecast
Would like a native Sailfish version of Plex for my Jolla
Just upgraded to Vivid Vervet this morning, and these steps worked for me, too. Thanks!
How do I do this for Ubuntu?
When i try this soloution i get the following error.
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled) Active: failed (Result: start-limit) since Sun 2015-04-26 12:46:32 BST; 9s ago Process: 2551 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=1/FAILURE)Any ideas on how to fix this?