初学 go,在部署的时候遇到了点问题,请大佬看下
参考 这篇文章 ,在/usr/lib/systemd/system
在文件夹下创建wombatapp.service
文件并写入内容,然后执行service wombatapp start
报错如下:
Failed to start wombatapp.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status wombatapp.service' for details
执行 systemctl status wombatapp.service
结果
● wombatapp.service - wombatapp
Loaded: loaded (/usr/lib/systemd/system/wombatapp.service; disabled; vendor preset: disabled)
Active: inactive (dead)
wombatapp.service 文件内容:
[Unit]
Description=wombatapp
[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/home/ec2-user/wombatapp
[Install]
WantedBy=multi-user.target
单独执行 wombatapp 文件是能成功运行的,
另外尝试了下用supervior
来管理到是很轻松,没遇到任何问题直接成功了
1
cszhiyue 2019-04-03 17:55:30 +08:00
看了下配置没问题
sudo apt install policykit-1 ? https://askubuntu.com/questions/1113470/org-freedesktop-policykit1-was-not-provided-by-any-service-files |
2
cszhiyue 2019-04-03 17:57:50 +08:00 1
另外建议用 sudo systemctl start wombatapp.service
|
3
zarte 2019-04-03 17:59:23 +08:00
直接后台运行呗。
|
6
wdlth 2019-04-03 22:43:03 +08:00
Type 有很多种的,可以换其他的如 forking, notify 试试效果
|