我希望它在我的 Ubuntu 服务器 18.x 上作为服务运行... https://github.com/xiaodoudou/PlexIPTV
我已经下载了 linux x64 文件,使其在我的主文件夹中可执行并尝试运行它。我还在同一文件夹中设置了初始 settings.json 文件。它工作得很好,所以为了将它作为一项服务,我尝试遵循本指南: 如何使可执行文件作为服务运行?
所以我在 中制作了文件/etc/systemd/system/
,如下所示:
[Unit]
Description=Plex IPTV-Tuner
After=network-online.target
[Service]
Type=simple
User=plex
Group=plex
UMask=007
ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
我还将可执行文件以及settings.json
文件移动到/usr/bin/PlexIPTV/
现在,当我尝试运行该文件夹时,我收到了不允许打开的错误消息/settings.json
。我也试过了chmod 777 -R /usr/bin/PlexIPTV/
,chown plex:plex -R /usr/bin/PlexIPTV
但没有帮助。
我得到的确切错误:
● plex-iptv-tuner.service - Plex IPTV-Tuner
Loaded: loaded (/etc/systemd/system/plex-iptv-tuner.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Sun 2019-03-10 13:09:02 CET; 1s ago
Process: 16218 ExecStart=/usr/bin/PlexIPTV/PlexIPTV.linux-x64 (code=exited, status=0/SUCCESS)
Main PID: 16218 (code=exited, status=0/SUCCESS)
Mar 10 13:09:02 media systemd[1]: Started Plex IPTV-Tuner.
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.397Z plexiptv:config:verbose 2019/03/10 13:09:02.3960 ? init Getting settings...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.398Z plexiptv:config:verbose 2019/03/10 13:09:02.3970 ? readSettings Reading file...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.399Z plexiptv:config:verbose 2019/03/10 13:09:02.3990 ? __dirname.readSettings.fs.readFile Didn't found file, injecting template...
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: 2019-03-10T12:09:02.410Z plexiptv:config:error 2019/03/10 13:09:02.4090 ? __dirname.init.Q.fcall.then.then.catch.error Error happen during setting pulling:
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: [ { Error: EACCES: permission denied, open '/settings.json'
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: errno: -13,
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: code: 'EACCES',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: syscall: 'open',
Mar 10 13:09:02 media PlexIPTV.linux-x64[16218]: path: '/settings.json' } ]
在 systemd 服务中,设置
WorkingDirectory
.