systemd 找不到我的 .service 文件

问题描述 投票:0回答:2

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
但它仍然不起作用, 感谢任何帮助:)

ubuntu systemd steam systemctl
2个回答
3
投票

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


0
投票

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

systemctl start game.service

激活它

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

然后做一个

systemctl daemon-reload && systemctl start game.service

© www.soinside.com 2019 - 2024. All rights reserved.