New Plex Media Server packaging (installer) for Linux.
We set out on this task to upgrade PMS’ packaging for all Linux systems.
A. The design criteria
-
Intelligent installer in the package itself.
a. Non-destructive pre-installation evaluation.
b. Not changing a running installation unless the installer knows it will succeed.
c. Capable of evaluating each system’s particular configuration and adapting to it.
d. Reporting errors as they are found in the Pre-installation and actual installation stages
e. Respecting the run-time state of PMS (running / stopped / enabled / disabled ) and restoring that state after installation
f. Correctly implement remove and purge on Debian-based systems
g. Be as “well behaved” as possible in Linux (atomic packaging operations) -
Linux distribution agnostic.
a. SystemD native support
b. SYSV-init native support -
Status report of what the installer found and how PMS is configured on the target system. This includes reporting if hardware transcoding capability has been found.
-
System log file tracking of installation activity. Final installation configuration also recorded in the system log to allow audit of automated download and installation via scripted methods.
-
Regardless of the system installed on, PMS will not
a. Break a running system in the installation process
b. Allow installation of PMS on a known-bad configuration.
B. What it looks like
A preview of what you’ll see now. Systemd or Init based no longer matters.
chuck@debian9-init:~$ sudo dpkg -i plexmediaserver_1.16.1.1227-7d24c1d30_amd64.deb
(Reading database ... 156356 files and directories currently installed.)
Preparing to unpack plexmediaserver_1.16.1.1227-7d24c1d30_amd64.deb ...
Shutting down Plex Media Server:
PlexMediaServer installer: Pre-installation Validation.
PlexMediaServer installer: Pre-installation Validation complete.
Unpacking plexmediaserver (1.16.1.1227-7d24c1d30) over (1.16.0.1220-147963d87) ...
Setting up plexmediaserver (1.16.1.1227-7d24c1d30) ...
PlexMediaServer installer:
PlexMediaServer installer: Now installing based on:
PlexMediaServer installer: Process Control: Init
PlexMediaServer installer: Plex User: plex
PlexMediaServer installer: Plex Group: plex
PlexMediaServer installer: Video Group: video
PlexMediaServer installer: Metadata Dir: /var/lib/plexmediaserver/Library/Application Support
PlexMediaServer installer: Temp Directory: /tmp
PlexMediaServer installer: Lang Encoding: en_US.UTF-8
PlexMediaServer installer: Config file used: /etc/default/plexmediaserver
PlexMediaServer installer: HW transcoding: Not found
PlexMediaServer installer:
PlexMediaServer installer: Completing final configuration.
PlexMediaServer installer: PlexMediaServer-1.16.1.1227-7d24c1d30 - Installation successful.
Processing triggers for libc-bin (2.24-11+deb9u4) ...
Processing triggers for gnome-menus (3.13.3-9) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
chuck@debian9-init:~$
Explaining the output:
a. Process Control - Whether systemd or init based.
b. Plex User - User name Plex is going to run as
c. Plex Group - Group name Plex is going to run as
d. Video Group - Group Plex will use for join for hardware transcoding
e. Metadata Dir - Where the Plex Library is.
f. Temp Dir - Temporary directory used for transcoding
g. Lang Encoding: - Language localization (locale) configured
h. Config file used: - Reported when a customized local configuration is detected
i. HW Transcoding - “Found” or “Not Found” (passive inspection during installation)
When Preinstallation validation is complete, Pre-install writes a combined “Log/Config” file to /tmp/plexinstaller.log. This file is used by actual installer postinst but also can be used to debug configuration problems including bringing that information to the forums for additional assistance.
Sample Error Messages
During Pre-installation validation, where the installer verifies the actual installation will succeed, it will report errors it finds. Configuration customizations (override files) are
A few examples of this are:
Error: Temp directory 'DirName' used in 'OverrideFile' file does not exist.
Error: Unknown username 'OverrideUser' used in OverrideFile'.
Error: Environment variable 'ForbiddenVar' not allowed in 'OverrideFile'
Forum Preview Goals:
- Test the new installer core software on Debian systems
- Correct any deficiencies or errors found
- Deploy as standard for all future Debian packaging.
- Integrate this installer as the core of the new RPM installer
Warnings
- It will not let you install into an configuration which cannot run
- The pre-installer is verbose and will tell you what it does not like.
- apt purge will really purge everything, just as a proper Linux purge should.
Please keep all discussion and support requests in this thread.
We will work through any issues as they come up. I expect a few minor ones but this should be a largely effortless on your part improvement.
The Download Links 1.16.1.1227 (updated PMS below)
I will update these as/if we need to make any changes along the way.
Please let me know how you make out, good or bad. It will help gauge when to put this into production use.
Update
04-July-2019 - Plex Media Server 1.16.2.1311
If no errors or edge conditions are found in this build, this packaging will become the new mainstream packaging for all Debian based systems.
Everyone’s input is welcome here
Update 07-Jul-2019
-
Fat fingered developer error; Fixed. Developer shot.
-
WSL2 - Now detected and blocked while in Alpha/Beta phase. Cannot support a moving target.
Same links as above, copied here.