## **************************************************************************
## For copyright and licensing terms, see the file named COPYING.
## **************************************************************************

[Unit]
Description=Plex Media Server for Linux

[Service]
# FIXME: Is this really needed?
systemdUserEnvironment=true
# FIXME: Is this really needed?
systemdWorkingDirectory=yes
Environment="PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=%S/%p/Library/Application Support"
Environment=PLEX_MEDIA_SERVER_HOME=/usr/lib/%p
Environment=PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
Environment=PLEX_MEDIA_SERVER_TMPDIR=/tmp
Environment=LD_LIBRARY_PATH=/usr/lib/%p
ExecStartPre=mkdir -p "${PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR}"
ExecStart='/usr/lib/%p/Plex Media Server'
User=plex
SessionLeader=yes
RestartSec=5

[Install]
WantedBy=server.target
