forked from mdhiggins/PlexAutoSkip
-
Notifications
You must be signed in to change notification settings - Fork 0
Run as Service Linux
InfinityPacer edited this page Apr 29, 2024
·
1 revision
在 Linux 中使用 services.d 设置 PlexAutoSkip 的步骤:
假设脚本安装在 /usr/local/pas
,请根据需要替换您的目录
- 转到
/etc/systemd/system/
- 创建一个新服务:
sudo vim PlexAutoSkip.service
- 粘贴以下模板并相应修改:
# Plex Auto Skip Service
[Unit]
Description=Plex Autoskip
[Service]
#User=YOUR_USER
#Group=YOUR_USER_GROUP
Type=simple
Environment=LC_ALL=C.UTF-8
Environment=LANG=C.UTF-8
WorkingDirectory=/usr/local/pas
ExecStart=/usr/bin/python3 /usr/local/pas/main.py
Restart=always
RestartSec=10
[Install]
WantedBy=default.target
- 加载新服务:
sudo systemctl --system daemon-reload
- 设置开机启动:
sudo systemctl enable PlexAutoSkip.service
- 启动服务:
sudo systemctl start PlexAutoSkip.service
- 调试/查看内部情况:
sudo journalctl -f -u PlexAutoSkip.service
感谢 DevMan01 的撰写。