Server Version#: All
Player Version#: n/a
The RPM versions of plexmediaserver have a pretty annoying bug that it seems isn’t going to get fixed as its been the case for years now. Its more of a problem though since I started using the repo for auto-updates rather than manually installing the latest RPM.
Every time Plex Media Server updates, it leaves plexmediaserver in stopped state, instead of restarting like every other RPM update does.
That’s good to hear, it would seem such a simple little thing that I was baffled it had been left like this for so long. (yeah I know, its not always that simple when supporting multiple platforms)
It’s simple for a single platform. Making it universal isn’t.
Additionally, I’ve overhauled the entire packaging mechanism.
The packaging is now agnostic - Docker, LXC, Init, Systemd
Here is where I was doing my final QA test this morning. (the actual release build numbers will be slightly different)
chuck@plexdev:~/Downloads$ sudo dpkg -i plexmediaserver_1.18.5.2194-74214c250_amd64.deb
(Reading database ... 187285 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.18.5.2194-74214c250_amd64.deb ...
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: INFO: /etc/systemd/system/plexmediaserver.service.d exists but no override 'conf' files found. Ignored.
PlexMediaServer install: Pre-installation Validation complete.
Unpacking plexmediaserver (1.18.5.2194-74214c250) over (1.18.5.2194-74214c250) ...
Setting up plexmediaserver (1.18.5.2194-74214c250) ...
PlexMediaServer install:
PlexMediaServer install: Now installing based on:
PlexMediaServer install: Process Control: Systemd
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: /var/lib/plexmediaserver/tmp_transcoding
PlexMediaServer install: Lang Encoding: en_US.UTF-8
PlexMediaServer install: HW transcoding: Found
PlexMediaServer install:
PlexMediaServer install: Completing final configuration.
PlexMediaServer install: Starting Plex Media Server.
PlexMediaServer install: PlexMediaServer-1.18.5.2194-74214c250 - Installation successful.
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
chuck@plexdev:~/Downloads$
Good to know this is about to be fixed. I was just getting around to reporting it after digging into the problem in the %pre scriptlet which caused the issue. I look forward to upgrading and not having to manually start Plex in the near future.
There is no detection in %pre.
Nothing from %pre is communicated forward.
Now there is.
The communication file, written in shell variable syntax, also serves as a diagnostic tool for when debugging or when revamping your site configuration (/etc/defaults or override.conf)
Cool. The bug in the current packages is that the %preun stops the service unconditionally. (I wrote %pre in my comment, but meant to write %preun.) According to the ordering of scriptlets, the %preun from the old package is run after the scriptlets from the new package, so despite the flag files in %pre and %post, the service was stopped by the %preun scriptlet run later in the upgrade process.
I’m not sure why the package scriptlets go to such lengths to stop the app and write a flag file to start it again. As opposed to the normal process of calling systemctl try-restart $service in %postun (inside an if [ $1 -ge 1 ] conditional).
But in any case, I’ll be glad to see this resolved. Thanks!
passively runs and validates all variables & locations needed to start the server
As errors are found, they are reported in detail.
If no errors are found, having now fully ingested all the runtime variables for the configruation, writes the configuration info to /tmp It looks like this:
# Plex Media Server installation configuration info: Thu Jan 9 12:36:13 EST 2020
Init=0
Systemd=1
LinuxContainer=0
NewInstall=0
HaveOverride=0
OverrideFile=""
PlexUser="plex"
PlexGroup="plex"
VideoGroup="video"
AppSuppDir="/var/lib/plexmediaserver/Library/Application Support"
PlexTempDir="/var/lib/plexmediaserver/tmp_transcoding"
LangEncoding="en_US.UTF-8"
HaveHardware=1
NeedUser=0
NeedGroup=0
NeedVideo=0
Verbose=1
IsRunning=1
From this, I know everything which needs to be done in %post / postinst . There is no guesswork. If there are no errors at the conclusion of %pre, I know installation will succeed and it’s OK to stop the server. If errors, loading stops here. Nothing is touched. The system continues as is.
With server stopped, the package manager is free to update all the package files
when unpacking is complete, I complete any setup tasks (this could also be a fresh installation) in %post.
Last thing I do is restore the state (if running).