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_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.
1

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.

1
User=plex
Group=plex
Process: 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Maya Lin-Takahashi

Maya Lin-Takahashi

Consumer Tech & Gadget Reviewer

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.

Share this article
Twitter Facebook Pinterest