我试图将花作为守护进程。我的flower.service文件如下:
[Unit]
Description=Flower Service
After=network.target
[Service]
Type=forking
User=maas
Group=maas
PermissionsStartOnly=true
ExecStart=/bin/flower --broker=amqp://oser000300//
[Install]
WantedBy=multi-user.target
但是当我开始服务时,却出错了。
//systemctl status flower.service
* flower.service - Flower Service
Loaded: loaded (/etc/systemd/system/flower.service; enabled; vendor preset: disabled)
Active: failed (Result: timeout) since Mon 2017-07-10 20:25:59 UTC; 4min 38s ago
Process: 49255 ExecStart=/bin/flower --broker=amqp://oser000300// (code=exited, status=0/SUCCESS)
Connected to amqp://guest:**@oser000300:5672//
flower.service start operation timed out. Terminating.
SIGTERM detected, shutting down
Failed to start Flower Service.
Unit flower.service entered failed state.
flower.service failed.
答案 0 :(得分:0)
启动服务时遇到了相同的超时问题。
这些参数完成了诀窍(我已经使用forking类型运行芹菜服务):
Type=simple
Restart=on-failure