systemd找不到我的.service文件

时间:2017-07-14 13:59:22

标签: ubuntu systemd steam lib systemctl

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但仍然无效, 任何帮助表示赞赏:)

2 个答案:

答案 0 :(得分:1)

game.service应放在/etc/systemd/system/game.service

答案 1 :(得分:0)

如果您将服务文件命名为game.service,则应使用systemctl start game.service

激活它

另一个建议:将您在/ etc / system / system / lib / systemd / system中创建的所有服务文件保留给系统单元。

然后执行systemctl daemon-reload && systemctl start game.service