如何在 Ubuntu 16.04 中设置 plexmediaserver?

如何在 Ubuntu 16.04 中设置 plexmediaserver?

我可以安装它,但它看不到我的文件。我相信这是一个权限问题,因为 plexmediaserver 由“plex”用户运行。在 Ubuntu 14.04 中,我可以编辑/etc/default/plexmediaserver以便由我运行它。它似乎在 16.04 中不起作用(因为 systemd?)。

我试过了http://www.htpcguides.com/install-plex-media-server-ubuntu-16-x-and-later/,使用 debian 源或使用 deb。我似乎无法启动服务。

[user@machine]:[~] $  sudo systemctl start plexmediaserver.service
Job for plexmediaserver.service failed because the control process exited with error code. See "systemctl status plexmediaserver.service" and "journalctl -xe" for details.
[user@machine]:[~] $ systemctl status plexmediaserver.service
● plexmediaserver.service - Plex Media Server for Linux
   Loaded: loaded (/etc/systemd/system/plexmediaserver.service; enabled; vendor preset: enabled)
  Drop-In: /etc/systemd/system/plexmediaserver.service.d
           └─local.conf
   Active: inactive (dead) (Result: exit-code) since lun. 2016-05-02 18:58:40 CEST; 34s ago
  Process: 2784 ExecStart=/bin/sh -c /usr/lib/plexmediaserver/Plex\ Media\ Server (code=exited, status=139)
  Process: 2779 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=0
 Main PID: 2784 (code=exited, status=139)

mai 02 18:58:35 machine systemd[1]: plexmediaserver.service: Unit entered failed state.
mai 02 18:58:35 machine systemd[1]: plexmediaserver.service: Failed with result 'exit-code'.
mai 02 18:58:40 machine systemd[1]: plexmediaserver.service: Service hold-off time over, scheduling restart.
mai 02 18:58:40 machine systemd[1]: Stopped Plex Media Server for Linux.
mai 02 18:58:40 machine systemd[1]: plexmediaserver.service: Start request repeated too quickly.
mai 02 18:58:40 machine systemd[1]: Failed to start Plex Media Server for Linux.
mai 02 18:59:02 machine systemd[1]: plexmediaserver.service: Start request repeated too quickly.
mai 02 18:59:02 machine systemd[1]: Failed to start Plex Media Server for Linux.

答案1

Ubuntu 16.04LTS 上的 Plex 媒体服务器(仅适用于 Plex-Pass 免费下载)

init.d是遗留的,所以忘记它吧,/etc/default/plexmediaserver因为它被忽略了。改用 systemctl。

设置它;添加 repo 以进行“自动”更新:

echo deb https://downloads.plex.tv/repo/deb ./public main | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
curl https://downloads.plex.tv/plex-keys/PlexSign.key | sudo apt-key add -
sudo apt update
sudo apt install plexmediaserver -y

为了避免权限问题,请以标准用户身份运行服务器,将“plex”替换为您的用户和组:

sudo nano /etc/systemd/system/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
Environment=LD_LIBRARY_PATH=/usr/lib/plexmediaserver
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 '/usr/lib/plexmediaserver/Plex\ Media\ Server'
Type=simple
User=user
Group=group
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target

现在还将下一个子目录的所有权更改为您的用户!

sudo chown -R user:group /var/lib/plexmediaserver
sudo systemctl --system daemon-reload
sudo service plexmediaserver start

现在您可以设置您的 pms。

相关内容