apt-get を使用してスーパーバイザーをインストールし、次に celeryd.conf (または任意の名前) という名前のファイルに以下を追加して、etc/supervisor/conf.d フォルダーに追加します (存在しない場合は conf.d フォルダーを作成します)。 )
; ==================================
; celery worker supervisor example
; ==================================
[program:celery]
; Set full path to celery program if using virtualenv
command=/home/<path to env>/env/bin/celery -A <appname> worker -l info
;enter the directory in which you want to run the app
directory=/home/<path to the app>
user=nobody
numprocs=1
stdout_logfile=/home/<path to the log file>/worker.log
stderr_logfile=/home/<path to the log file>/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 = 1000
; 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
また、次の行を etc/supervisor/supervisord.conf に追加します。
[include]
files = /etc/supervisor/conf.d/*.conf
ここで、ターミナルに Supervisord と入力してスーパーバイザーを起動すると、上記の設定に従ってセロリが自動的に起動します。