Unable to Start Plexmediaserver Service
My Plexmediaserver. Service Looks as per Following. [Unit] Description=Plex Media Server for Linux After=Network. Target [Service] Environment="Plex_Media_Serve...
My plexmediaserver.service looks as per following.
[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
Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
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 '/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
and error i get is as per following
● plexmediaserver.service - Plex Media Server for Linux
Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
Active: inactive (dead) (Result: exit-code) since Sun 2016-12-11 17:15:21 EST; 6min ago
Process: 4417 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" || /bin/mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}" (code=exited, status=217/USER)
Main PID: 3588 (code=killed, signal=TERM)
Dec 11 17:15:21 ubuntuServer systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
Dec 11 17:15:21 ubuntuServer systemd[1]: Stopped Plex Media Server for Linux.
Dec 11 17:15:21 ubuntuServer systemd[1]: plexmediaserver.service: Start request repeated too quickly.
Dec 11 17:15:21 ubuntuServer systemd[1]: Failed to start Plex Media Server for Linux.
3 Answers
By doing bit more of research, I could find fix. By executing below 3 commands, it worked.
sudo mkdir /var/lib/plexmediaserver/Library
chmod 777 -R /var/lib/plexmediaserver/Library
service plexmediaserver restart
Assuming you already have user plex and group plex in that os.
Then you can just use sudo chown -R plex:plex /var/lib/plexmediaserver to change the ownership of plexmediaserver and its sub directories.
User=plex Group=plexProcess: 4417 ExecStartPre= … (code=exited, status=217/USER)
So create the missing user account, then.
Environment="…=/var/lib/plexmediaserver/ Library/Application Support"
And when you copy and paste things, check them.