初学 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来管理到是很轻松,没遇到任何问题直接成功了