Supervisor

To kill a supervisor instance:

sudo unlink /tmp/supervisor.sock

To run in foreground for debugging

supervisord -c my_supervisor_file.conf -n

In your .conf file under the supervisord block, you can add all the environment key=value pairs as such

[supervisord]
environment=CELERY_BROKER_URL=”amqp://guest:guest@127.0.0.1:5672//”,FLASK_CONFIG=”TESTING”

[program:celeryd]
command=celery worker -A celery — loglevel=info -P gevent -c 1000

If you dont want to hardcode the variables but want to pull it in from the os environment,

>> sudo export CELERY_BROKER_URL=”amqp://guest:guest@127.0.0.1:5672//”
>> . ~/.bashrc

Now change the .conf to

[supervisord]
environment=CELERY_BROKER_URL=”%(ENV_CELERY_BROKER_URL)s”,FLASK_CONFIG=”%(ENV_FLASK_CONFIG)s”

[program:celeryd]
command=celery worker -A celery — loglevel=info -P gevent -c 1000

[1]: http://supervisord.org/configuration.html#environment-variables