Server Version#: OpenSUSE 15.0
Player Version#: Not Sure but not relevant
So this is a little strange but I started to change my Library paths because I reorganized things and my PlexMediaServer crashed. After that when I tried to start it I could not connect even though it said it was running just fine.
So I spent quite a long time trying to figure it out and eventually found out that that if I put the equivalent script in a bash file to what was in PlexMediaServer.service and run the bash file it works just fine.
I haven’t any ideas on why all this happened except perhaps before I started changing library paths some sort of caching was keeping things going fine but once whatever that caching was got cleared it no longer worked… but that’s just speculation.
The facts are as follows…
This runs but I cannot connect which is used when I run service plexmediaserver start and is just the default script that is created when you install the Plex server:
[Unit]
Description=Plex Media Server
After=network.target network-online.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=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_SUPPORT_DIR}"'
ExecStart=/bin/sh -c '\
PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \\$2}" | tr -d \\" )" \
PLEX_MEDIA_SERVER_INFO_DEVICE="PC" \
PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)" \
PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(grep ^VERSION= /etc/os-release | awk -F= "{print \\$2}" | tr -d \\" )" \
LD_LIBRARY_PATH=/usr/lib/plexmediaserver/lib \
"/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
However, when I create an equivalent script in bash and run it connecting is no problem and everything works perfectly AFAICT. Here is the script I wrote that is working:
#!/bin/sh
sudo -u plex \
export LANG='en_US.UTF-8'; \
export LC_ALL='en_US.UTF-8'; \
export LD_LIBRARY_PATH='/usr/lib/plexmediaserver/lib'; \
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR='/srv/multimedia/plexmediaserver/Library/Application Support'; \
export PLEX_MEDIA_SERVER_HOME='/usr/lib/plexmediaserver'; \
export PLEX_MEDIA_SERVER_INFO_VENDOR="$(grep ^NAME= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )"; \
export PLEX_MEDIA_SERVER_INFO_DEVICE="PC"; \
export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"; \
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(grep ^VERSION= /etc/os-release | awk -F= "{print \$2}" | tr -d \" )"; \
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6; \
export PLEX_MEDIA_SERVER_TMPDIR='/tmp'; \
"/usr/lib/plexmediaserver/Plex Media Server"
The only thing I can think of is that maybe a system upgrade added some new Linux security feature that’s on by default that I don’t know about which is affecting Plex starting through systemd but again, that’s just speculation, perhaps someone knows something for real?