[program:celeryd]
; Set full path to celery program if using virtualenv
command=/vdc_backend/venv/bin/celery worker -A celery_worker.celery --loglevel=info
directory=/vdc_backend/app
user=root
numprocs=1
stdout_logfile=/var/log/celery/worker.log
stderr_logfile=/var/log/celery/worker.log
autostart=true
autorestart=true
startsecs=10
; Need to wait for currently executing tasks to finish at shutdown.
; Increase this if you have very long running tasks.
stopwaitsecs = 600
; Causes supervisor to send the termination signal (SIGTERM) to the whole process group.
stopasgroup=true
; Set Celery priority higher than default (999)
; so, if rabbitmq is supervised, it will start first.
priority=1000
/etc/supervisord.conf
[include]
files = /etc/celery/*.conf
celery如果需要root用户,代码配置
from celery import Celery, platforms
platforms.C_FORCE_ROOT = True