セロリ機能を備えたdjangoアプリがあるので、以下のようにセロリを正常に実行できます
celery -A tasks worker --loglevel=info
しかし、デーモンとして実行する必要があるという既知の事実として、フォルダーcelery.conf
内に以下のファイルを書きました/etc/supervisor/conf.d/
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
command=/root/Envs/proj/bin/celery -A app.tasks worker --loglevel=info
user=root
environment=C_FORCE_ROOT="yes"
environment=HOME="/root",USER="root"
directory=/root/apps/proj/structure
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
; When resorting to send SIGKILL to the program to terminate it
; send SIGKILL to its whole process group instead,
; taking care of its children as well.
killasgroup=true
; if rabbitmq is supervised, set its priority higher
; so it starts first
priority=998
しかし、スーパーバイザーを次のように更新しようとすると、supervisorctl reread
からsupervisorctl update
メッセージが表示されましたsupervisorctl status
celery FATAL Exited too quickly (process log may have details)
だから私はworker.log
ファイルに行き、以下のようなエラーメッセージを見ました
Running a worker with superuser privileges when the
worker accepts messages serialized with pickle is a very bad idea!
If you really want to continue then you have to set the C_FORCE_ROOT
environment variable (but please think about this before you do).
User information: uid=0 euid=0 gid=0 egid=0
C_FORCE_ROOT
では、スーパーバイザーの conf ファイル内で環境変数として設定したにもかかわらず、なぜ文句を言って いるのでしょうか? 上記のconfファイルで何が間違っていますか?