1.20 update fails - systemd config error

OS Version: Linux Mint 18 “Sarah” (based on Ubuntu 16.04)

Current Plex Server Version #: 1.14.0.5470
Attempting update to Plex Server Version #: 1.20.1.3252

Fails during pre-installation check:

# dpkg -i ./plexmediaserver_1.20.1.3252-a78fef9a9_amd64.deb
(Reading database ... 263545 files and directories currently installed.)
Preparing to unpack .../plexmediaserver_1.20.1.3252-a78fef9a9_amd64.deb ...
Removed symlink /etc/systemd/system/multi-user.target.wants/plexmediaserver.service.
PlexMediaServer install: Pre-installation Validation.
PlexMediaServer install: Systemd configuration error detected:
PlexMediaServer install: File "/etc/systemd/system/plexmediaserver.service" is leftover from an earlier Debian/Ubuntu bug.
PlexMediaServer install: Please transfer any customizations \(APP_DIR, User, Group, TMPDIR, and/or UMask\) to a proper "/override.conf"
PlexMediaServer install: and reinstall.
PlexMediaServer install: Unit override "/etc/systemd/system/plexmediaserver.service" found.
PlexMediaServer install: Only "/etc/systemd/system/plexmediaserver.service.d/override.conf" is supported.
PlexMediaServer install: 
PlexMediaServer install: Pre-installation Validation failed.
PlexMediaServer install: Configuration information discovered:
PlexMediaServer install:   Installation Type:  Update
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:     /tmp
PlexMediaServer install:   Lang Encoding:      en_US.UTF-8
PlexMediaServer install:   Transcoding HW:     Found
PlexMediaServer install: 
PlexMediaServer install: Pre-installation Validation complete.
dpkg: error processing archive ./plexmediaserver_1.20.1.3252-a78fef9a9_amd64.deb (--install):
 subprocess new pre-installation script returned error exit status 1
Created symlink from /etc/systemd/system/multi-user.target.wants/plexmediaserver.service to /etc/systemd/system/plexmediaserver.service.
Processing triggers for libc-bin (2.23-0ubuntu11.2) ...
Errors were encountered while processing:
 ./plexmediaserver_1.20.1.3252-a78fef9a9_amd64.deb
# cd /etc/systemd/system

# ls -1
bluetooth.target.wants
dbus-org.bluez.service
dbus-org.freedesktop.Avahi.service
dbus-org.freedesktop.ModemManager1.service
dbus-org.freedesktop.nm-dispatcher.service
dbus-org.freedesktop.thermald.service
default.target.wants
display-manager.service
display-manager.service.wants
final.target.wants
getty.target.wants
graphical.target.wants
hddtemp.service
hibernate.target.wants
hybrid-sleep.target.wants
multi-user.target.wants
network-online.target.wants
ntp.service
paths.target.wants
plexmediaserver.service
plexmediaserver.service.prev
printer.target.wants
remote-fs.target.wants
rsyncd@.service
sockets.target.wants
sshd.service
suspend.target.wants
sysinit.target.wants
syslog.service
timers.target.wants

# cat plexmediaserver.service
[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
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 'LD_LIBRARY_PATH=/usr/lib/plexmediaserver /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
#

1 Like

The error message also includes the remedy.

PlexMediaServer install: Systemd configuration error detected:
PlexMediaServer install: File "/etc/systemd/system/plexmediaserver.service" is leftover from an earlier Debian/Ubuntu bug.
PlexMediaServer install: Please transfer any customizations \(APP_DIR, User, Group, TMPDIR, and/or UMask\) to a proper "/override.conf"
PlexMediaServer install: and reinstall.
PlexMediaServer install: Unit override "/etc/systemd/system/plexmediaserver.service" found.
PlexMediaServer install: Only "/etc/systemd/system/plexmediaserver.service.d/override.conf" is supported.
PlexMediaServer install: 

Thanks for the response.

Since Plex is asking us to change our systemd directory to a different structure than is currently used on the system (creating new service sub-directories that are not currently present), it would be nice if the message was a bit more specific.

Is Plex telling us to copy plexmediaserver.service to ./plexmediaserver.service.d/override.conf and then delete the original plexmediaserver.service file? This will make Plex happy? But what does it do to the systemd service running on our computer? Will this now-missing service file hose that up? Not everybody is a systemd expert - personally, I haven’t played with it for years, what little I knew - very little - has been mostly forgotten.

I wouldn’t say that “the error message includes the remedy”. I would say that, best case, it “hints at the remedy”. Leaving people who are not terribly familiar with systemd to fend for themselves. When the error message says to transfer all your customizations to an override.conf file, is that talking about only moving PART of the unit file to override.conf? Just the customization part? What are considered the customizations then? I didn’t create this unit file or modify it, evidently Plex did during a previous install.

I’m sorry but you’re mistaken.

  1. Ubuntu made the mistake when 16.04 was released.
  2. They have since corrected it and placed all service files in /lib/systemd/system/*.service

All you need to do is look for any customizations you’ve made in the /etc version.
If you have none, simply delete it.

Any changes belong in a systemd override file of the standard override.conf form.

There are many references but the simplest is this format.

[Service]

User=xxxxxx
Group=xxxxxx
Environment="VariableName=value"

The easiest way to make the file go to the right place:

sudo systemctl edit plexmediaserver

Now you have an editor environment which will put the file where it needs to be.
Please remember to move the other file from /etc before reinstalling.

Thanks. That explanation helps. You mentioned that /lib is the correct location now. I do indeed have a plexmediaserver.service file in that filesystem. And I also have the questionable one in the /etc filesystem. I will delete/rename the /etc version. Do the override.conf files go in the /lib filesystem or in the /etc/filesystem? The error message from the Plex installer does not mention /lib that I can see. It only talks about /etc. I did not make any customizations to the server file. Not manually, anyway - unknown if Plex customized the file on my behalf based on changes I might have made during the original install or via the web GUI.

If you’ll show me what you have in /etc/systemd/system/plexmediaserver.service,
I’ll craft the file which goes in /etc/systemd/system/plexmediaserver.service.d/override.conf

Plex doesn’t modify any system configuration files on your behalf.
It’s setup to be an atomic package. By keeping it this way, when you remove and purge, there is no trace of it afterwards. It’s very easy to delete manually if needed.

Thanks. I already quoted that in my initial post to this thread. See above, first post in this thread. It’s in the second scrolling box that starts with “cd /etc/systemd/system” at the top (this second box is below the first box containing dpkg and the Plex install errors). Down where it says “cat plexmediaserver.service” That’s the file in /etc/systemd/system/

Thank you.

I didn’t scroll down far enough. My apologies.

That is the old file as it was initially distributed.

You’re free to do the following.

sudo bash
systemctl stop plexmediaserver
rm  /etc/systemd/system/plexmediaserver.service
systemctl daemon-reload

Now you can install Plex.

When installation is complete.

sudo systemctl enable plexmediaserver
sudo systemctl start plexmediaserver

Enable sets it for auto start at boot.
Start makes it start now.

Thank you!

That worked. I am now up and running on the new version of Plex server.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.