在 CentOS 上让 Jellyfin 开机自启,主要取决于你是 CentOS 7/8(systemd) 还是 CentOS 6(init.d)。现在大多数 CentOS 都是 systemd,下面以最常见情况说明。
systemctl status jellyfin
如果显示 active (running) 或 inactive,说明已经有服务文件。
sudo systemctl enable jellyfin
sudo systemctl start jellyfin
systemctl is-enabled jellyfin
返回:
enabled ✅ 已设置开机启动disabled ❌ 未设置sudo vi /etc/systemd/system/jellyfin.service
示例内容(按你的安装路径修改):
[Unit]
Description=Jellyfin Media Server
After=network.target
[Service]
Type=simple
User=jellyfin
ExecStart=/opt/jellyfin/jellyfin
Restart=on-failure
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable jellyfin
sudo systemctl start jellyfin
chkconfig jellyfin on
service jellyfin start
firewall-cmd --permanent --add-port=8096/tcp
firewall-cmd --reload
journalctl -u jellyfin -f
如果你能告诉我:
我可以给你更精确的步骤。