I just tried to upgrade Plex on my Ubuntu server to plexmediaserver_1.19.1.2621-b249be3b0_amd64.deb. After upgrading I tried to run ‘sudo start plexmediaserver’ and this did not do anything (I checked process tree etc.)
I did ‘tail /var/log/upstart/plexmediaserver.log’ and saw:
start-stop-daemon: unable to stat /usr/sbin/start_pms (No such file or directory)
start-stop-daemon: unable to stat /usr/sbin/start_pms (No such file or directory)
start-stop-daemon: unable to stat /usr/sbin/start_pms (No such file or directory)
start-stop-daemon: unable to stat /usr/sbin/start_pms (No such file or directory)
start_pms was removed because /etc/init.d/plexmediaserver was completed to fully contain all the functionality of /usr/sbin/start_pms. That made start_pms which was previously called by /etc/init.d/plexmediaserver redundant and no longer needed.
If you wish to have /usr/sbin/start_pms, all you need do is create it to call /etc/init.d/plexmediaserver start and launch PMS as the service it should be.
It will use all the same values from /etc/default/plexmediaserver
Discussion thread is here:
We did find one timing issue with it which I’ve corrected and is coming as a hotfix.
Docker (svscan, binhex, and tini) are left alone to use their start mechanisms as they are in control. The installer performs no checks when any of these three are detected because they are in control of the runtime environment.
LXC’s (which are init or systemd based) use what I already provide.
Any other container environment is deemed custom.
I do provide for everyone, in /usr/lib/plexmediaserver/lib,
plexmediaserver.service - Backup copy of the systemd service plexmediaserver.default, - Base template of /etc/default/plexmediaserver plexmediaserver.init - Backup copy of /etc/init.d/plexmediaserver
These are provided for use as anyone deems appropriate post installation.
If these are going to be used, I suggest the use of symbolic links.
Symlinks will allow me to freely update as PMS evolves without anyone needing to worry.
My goal is to make it as easy as possible to run PMS in just about any way which can be imagined, providing a bit of structure, with a touch of validation, in order to save hours of head-banging against the keyboard (yes I’ve been there too)
(Reading database ... 67875 files and directories currently installed.)
Preparing to replace plexmediaserver 1.18.9.2571-e106a8a91 (using plexmediaserver_1.19.1.2621-b249be3b0_amd64.deb) ...
stop: Unknown instance:
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking replacement plexmediaserver ...
Setting up plexmediaserver (1.19.1.2621-b249be3b0) ...
PlexMediaServer install: PlexMediaServer-1.19.1.2621-b249be3b0 - Installation starting.
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Installation Type: Update
PlexMediaServer install: Process Control: init
PlexMediaServer install: Plex User: plex
PlexMediaServer install: Plex Group: plex
PlexMediaServer install: Video Group: video
PlexMediaServer install: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer install: Temp Directory: /tmp
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: Config file used: /etc/default/plexmediaserver
PlexMediaServer install: Transcoding HW: Not found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
System start/stop links for /etc/init.d/plexmediaserver already exist.
PlexMediaServer install: PlexMediaServer-1.19.1.2621-b249be3b0 - Installation successful.
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
$ diff /etc/init.d/plexmediaserver /usr/lib/plexmediaserver/lib/plexmediaserver.init
$ #no diff was reported
This means that /etc/init.d/plexmediaserver was correctly replaced. All good. My initial understanding was incorrect!
However running sudo /etc/init.d/plexmediaserver start still didn’t work despite repeated attempts. So I dug around to debug /etc/init.d/plexmediaserver and identified the issue at this line in the file: export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support"
$HOME here is getting evaluated too early - before we’ve called su to switch the user over to $PLEX_MEDIA_SERVER_USER.
I was able to successfully start the server after I replaced that line with: export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="/var/lib/plexmediaserver/Library/Application Support"
So I guess this looks like a bug that should be fixed in that script?
I had a quick look at /etc/init.d/plexmediaserver.prev since it was stored during package update and I see that PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR is not set anywhere in that script. In that original code I see the line su -l $PLEX_MEDIA_SERVER_USER -s /bin/sh -c "/usr/sbin/start_pms &" >/dev/null 2>&1 so I assume start_pms would have created/evaluated that variable - in which case it would evaluate correctly since su had already been called.
`
Thanks. Had a quick look at the tar.gz and that looks like it’ll work. I’m not going to test it - I’ll just wait for the next release. I think this solves my problem so I’ll mark this as solved
So if I want to continue using the newest builds, and step away from using start_pms, like I have been for years, what are the steps I need to take to resolve?
Now that start_pms has been removed from the manifest, if you want to put it back manually, that’s up to you. Maintenance of it will be your responsibility. I will no longer support it.
That’s not right. It has never failed to detect Init on Ubuntu.
I have Ubuntu on my desktop (19.10 at present).
I have all the supported Ubuntu and Debian versions in VM.
Which actual 1.19.1 DEB did you install ?
I’ll give you the proper /et/init.d/plexmediaserver. I’m more concerned with why it went sideways at this point.