如何在Ubuntu 16.04中设置plexmediaserver?


12

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

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

[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.

Answers:


23

Ubuntu 16.04LTS上的Plex Media Server(仅适用于Plex-Pass的免费下载)

init.d是遗留物,因此请忘记,/etc/default/plexmediaserver因为它被忽略了。而是使用systemctl。

设置;添加“自动”更新的仓库:

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。


太棒了,它有效!谢谢 !!注意:不确定sudo systemctl --system daemon-reload && sudo service plexmediaserver startPlex是否以我的用户(cf ps aux | grep plex)的身份运行,所以我进行了重新启动并成功了。
user2287453 '16

1
我在使用PMS 1.0.3重新安装16.04时遇到问题。原来,我/etc/systemd/system/plexmediaserver.service是空白。我将用户分配为用户名,将组分配为配置文件以及var/lib/plexmediaserver目录。工作得很好。我不需要重新启动,只需重新启动服务即可。
Manuel J. Diaz

1
Ubuntu 16.10在这里,/etc/...路径没有退出。使用locate plexmediaserver.service,它在下找到了它/lib/systemd/system/plexmediaserver.service。在这里更改用户和组并重新启动服务就像一个魅力!
Alex Tartan

1
我认为这个答案不再正确,因为看起来好像Plex人重组了他们的网站并且不幸地摆脱了apt repo:E:无法获取downloads.plex.tv/repo/deb/dists/public/main / binary-amd64 /… CONNECT之后从代理接收到HTTP代码403
happyskeptic

没用.. plex是在Linux上安装的一种耻辱。厌倦了plex虫。要嵌入,看起来像狗屎,但至少他们知道如何编程
snickers2k
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.