關于 supervisor 進程管理問題
- 通過設置 priority 并無法解決 worker 進程啟動完畢之后再啟動 flower 的樣子
priority 只是定義了啟動順序。
http://supervisord.org/configuration.html
https://github.com/Supervisor/supervisor/issues/122
可以通過設置 `celery-flower` 的 `autostart=true` 為 `autostart=false` 然后再手動進行啟動
```
$ supervisorctl? ? ? ?
celery-beat? ? ? ? ? ? ? ? ? ? ? STARTING??
celery-flower? ? ? ? ? ? ? ? ? ? STOPPED? ?Not started
celery-worker? ? ? ? ? ? ? ? ? ? STARTING??
supervisor> help
default commands (type help <topic>):
=====================================
add? ? exit? ? ? open? reload? restart? ?start? ?tail? ?
avail? fg? ? ? ? pid? ?remove? shutdown? status? update?
clear? maintail? quit? reread? signal? ? stop? ? version
supervisor> status
celery-beat? ? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37555, uptime 0:00:17
celery-flower? ? ? ? ? ? ? ? ? ? STOPPED? ?Not started
celery-worker? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37556, uptime 0:00:17
supervisor> start celery-flower?
celery-flower: started
supervisor> status
celery-beat? ? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37555, uptime 0:00:41
celery-flower? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37611, uptime 0:00:15
celery-worker? ? ? ? ? ? ? ? ? ? RUNNING? ?pid 37556, uptime 0:00:41
supervisor>?
```
或者使用一個腳本監聽 `celery-worker` 的 `status` 進行判斷 如果是 `RUNNING` 則可以進行啟動 `celery-flower`
```
$ supervisorctl status celery-worker | awk '{print $2}'
RUNNING
```
2019-08-04
不知道老師有沒有其他解決方案。還望得到回復。