我的 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
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
我得到的错误如下
● 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 条命令,它起作用了。
sudo mkdir /var/lib/plexmediaserver/Library
chmod 777 -R /var/lib/plexmediaserver/Library
service plexmediaserver restart
答案2
假设您在该操作系统中已经拥有用户plex
和组。plex
然后您就可以用它sudo chown -R plex:plex /var/lib/plexmediaserver
来更改 plexmediaserver 及其子目录的所有权。
答案3
用户=plex 组=plex进程:4417 ExecStartPre=…(代码=已退出,状态=217/USER)
因此,请创建缺少的用户帐户。
环境=“…= / var / lib / plexmediaserver /库/应用程序支持”
当你复制和粘贴内容时,请检查它们。