title: Running Flower using Supervisor
body: <p>Am having challanges starting flower using supervisor.</p>
  
  <p>The following command in my development environment works on the console</p>
  
  <p><code>celery --app=celery_conf.celeryapp flower --conf=flowerconfig</code></p>
  
  <p>but moving to production to use supervisor am getting all sorts of errors</p>
  
  <p><strong>/supervisor/conf.d/flower.conf</strong></p>
  
  <pre><code>[program:flower]
  command=/opt/apps/venv/my_app/bin/celery flower --app=celery_conf.celeryapp --conf=flowerconfig
  directory=/opt/apps/my_app
  user=www-data
  autostart=true
  autorestart=false
  redirect_stderr=true
  stderr_logfile=/var/log/celery/flower.err.log
  stdout_logfile=/var/log/celery/flower.out.log
  </code></pre>
  
  <p>With the above configuration, there is no error but all celery does is give me a help like output. Its like it doesn't acknowledge the variables passed.</p>
  
  <pre><code> Type 'celery &lt;command&gt; --help' for help using a specific command.
   Usage: celery &lt;command&gt; [options]
   Show help screen and exit.
   Options:
     -A APP, --app=APP     app instance to use (e.g. module.attr_name)
     -b BROKER, --broker=BROKER
                           url to broker.  default is 'amqp://guest@localhost//'
     --loader=LOADER       name of custom loader class to use.
     etc..
     etc..
     etc...
  </code></pre>
  
  <p>Supervisor on the other hand throws <code>INFO exited: flower (exit status 64; not expected)</code></p>
  
  <p>I have other supervisor initiated apps using <code>celery_beat</code> and using the <a href="https://github.com/celery/celery/blob/3.1/extra/supervisord/celerybeat.conf" rel="noreferrer">configuration file samples on github</a> and they are working well with the same directory paths as above</p>
  
  <p>The flowerconfig is as below:</p>
  
  <p><strong>flowerconfig.py</strong></p>
  
  <pre><code># Broker settings
  BROKER_URL = 'amqp://guest:guest@localhost:5672//'
  
  # RabbitMQ management api
  broker_api = 'http://guest:guest@localhost:15672/api/'
  
  #Port
  port = 5555
  
  # Enable debug logging
  logging = 'INFO'
  </code></pre>
  
  <p><strong>Solution:</strong></p>
  
  <p>Well, not really a solution so I haven't put it as an answer. Turned out there was a problem with my virtual environment. So I removed flower and installed again using pip3.4 as am on python3.4</p>
  
  <p>Something to note though is that for flower to use your <code>flowerconfig</code> file, you need to add a <code>director=/path/to/your/celery_config/folder/</code> entry in supervisor's <code>/etc/supervisor/conf.d/flower.conf</code> file else flower will launch with default settings.</p>
  
  <p><strong>/etc/supervisor/conf.d/flower.conf</strong></p>
  
  <pre><code>; ==================================
  ;  Flower: For monitoring Celery
  ; ==================================
  [program:flower]
  command=/opt/apps/venv/my_app/bin/celery flower --app=celery_conf.celeryapp --conf=flowerconfig
  directory=/opt/apps/my_app/celery_conf #this is key as my configuration file was in the `celery_conf` folder
  user=www-data
  autostart=true
  autorestart=false
  redirect_stderr=true
  stderr_logfile=/var/log/celery/flower.err.log
  stdout_logfile=/var/log/celery/flower.out.log
  </code></pre>
  
  <p>Thanks.</p>