title: Celery not running in production
body: <p>I am trying to run celery and celerybeat in production. In my current django app I am able to test and run using the commands "celery -A Gorgon worker" and "celery -A Gorgon beat -l debug --max-interval=10". Also, I am running it through a virtualenv. Also, I am using redis as the task broker.</p>
  
  <p>The whole app is running on a gunicorn server. But, when I try to daemonize the process it fails with a 111 connection error.</p>
  
  <p>I have added the required scripts from <a href="https://github.com/celery/celery/tree/3.0/extra/generic-init.d" rel="nofollow">https://github.com/celery/celery/tree/3.0/extra/generic-init.d</a> into the directory /etc/init.d</p>
  
  <p>As for the scripts in the /etc/defaults, they look like this:</p>
  
  <p>My celeryd script is as follows</p>
  
  <pre><code># Names of nodes to start
  #   most will only start one node:
  
  CELERYD_NODES="worker1"
  
  #   but you can also start multiple and configure settings
  #   for each in CELERYD_OPTS (see `celery multi --help` for examples).
  #CELERYD_NODES="worker1 worker2 worker3"
  # Absolute or relative path to the 'celery' command:
  #CELERY_BIN="/usr/local/bin/celery"
  
  CELERY_BIN="/home/ubuntu/sites/virtualenv/bin/celery"
  
  # App instance to use
  # comment out this line if you don't use an app
  
  CELERY_APP="Gorgon"
  
  # or fully qualified:
  #CELERY_APP="proj.tasks:app"
  # Where to chdir at start.
  
  CELERYD_CHDIR="/home/ubuntu/sites/source"
  
  # Extra command-line arguments to the worker
  
  CELERYD_OPTS="--time-limit=300 --concurrency=8"
  
  # %N will be replaced with the first part of the nodename.
  
  CELERYD_LOG_FILE="/var/log/celery/%N.log"
  CELERYD_PID_FILE="/var/run/celery/%N.pid"
  
  # Workers should run as an unprivileged user.
  #   You need to create this user manually (or you can choose
  #   a user/group combination that already exists, e.g. nobody).
  #CELERYD_USER="celery"
  #CELERYD_GROUP="celery"
  # If enabled pid and log directories will be created if missing,
  # and owned by the userid/group configured.
  
  CELERY_CREATE_DIRS=1
  </code></pre>
  
  <p>My celerybeat script is</p>
  
  <pre><code># Absolute or relative path to the 'celery' command:
  
  CELERY_BIN="/home/ubuntu/sites/virtualenv/bin/celery"
  
  #CELERY_BIN="/virtualenvs/def/bin/celery"
  # App instance to use
  # comment out this line if you don't use an app
  
  CELERY_APP="Gorgon"
  
  # or fully qualified:
  #CELERY_APP="proj.tasks:app"
  # Where to chdir at start.
  
  CELERYBEAT_CHDIR="/home/ubuntu/sites/source"
  
  # Extra arguments to celerybeat
  #CELERYBEAT_OPTS="--schedule=/var/run/celery/celerybeat-schedule"
  </code></pre>
  
  <p>How do it get my celery setup running as a daemon using my current virtual env in /home/ubuntu/sites/virtualenv</p>