systemd 找不到我的 .service 文件
[Unit]
Description=Game Server
[Service]
Type=simple
User=steam
Group=steam
Restart=on-failure
ExecStop=killall -TERM srcds_linux
[Install]
WantedBy=multi-user.target
它保存在
/lib/systemd/system/game.service
下
当我
systemctl start csgo.service
时,它说Unit csgo.service failed to load: No such file or directory. See system logs and 'systemctl status csgo.service' for details.
我已经完成了
systemctl --system daemon-reload
但它仍然不起作用,
感谢任何帮助:)
game.service 应放置在 /etc/systemd/system/game.service 中
如果您将服务文件命名为 game.service,则应使用
systemctl start game.service
激活它
另一个建议:将您创建的所有服务文件放在 /etc/system/system 中 /lib/systemd/system 是为系统单元保留的。
然后做一个
systemctl daemon-reload && systemctl start game.service