Ubuntu systemd找不到我的.service文件

Ubuntu systemd找不到我的.service文件,ubuntu,systemd,steam,lib,systemctl,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启动csgo.ser

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启动csgo.service
时,它说
Unit csgo.service加载失败:没有这样的文件或目录。有关详细信息,请参阅系统日志和“systemctl status csgo.service”。

我已经完成了
systemctl--system daemon reload
,但它仍然不工作,
非常感谢您的帮助:)

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

另一个建议是:将您创建的所有服务文件放在/etc/system/system/lib/systemd/system中,因为它是为系统单元保留的


然后执行
systemctl守护进程重新加载和&systemctl启动游戏.service

如果您将服务文件命名为game.service,则应使用
systemctl启动游戏.service将其激活

另一个建议是:将您创建的所有服务文件放在/etc/system/system/lib/systemd/system中,因为它是为系统单元保留的


然后执行一个
systemctl守护进程重新加载和&systemctl启动游戏。service

游戏。service应放在/etc/systemd/system/game。service

游戏。service应放在/etc/systemd/system/game.service中