title: Running celery as daemon does not create PID file
body: <p>I have been scratching my brains on this one since past few days, I have seen other issues on stackoverflow (as it is a duplicate question) and I have tried everything to make this work, the workers are running fine but the celery is not starting up as a process.</p>
  
  <p>I run the command:</p>
  
  <pre><code>sudo service celeryd start
  </code></pre>
  
  <p>and I get:</p>
  
  <pre><code>celery init v10.1.
  Using config script: /etc/default/celeryd
  celery multi v3.1.23 (Cipater)
  &gt; Starting nodes...
      &gt; worker1@ip-172-31-21-215: OK
  </code></pre>
  
  <p>I run:</p>
  
  <pre><code>sudo service celeryd status
  </code></pre>
  
  <p>and I get:</p>
  
  <pre><code>celery init v10.1.
  Using config script: /etc/default/celeryd
  celeryd down: no pidfiles found
  </code></pre>
  
  <p>The <strong>celeryd down: no pidfiles found</strong> error is what I need to resolve.</p>
  
  <p>I know this question is a duplicate one but still go along with me on this one because I have tried all of them and still unable to get it resolved.</p>
  
  <p>I am deploying this script on Amazon Web Services. I am using a virtual environment.</p>
  
  <p>The <code>init.d</code> script is taken directly from the <a href="https://github.com/celery/celery/blob/master/extra/generic-init.d/celeryd" rel="noreferrer">here</a> and then I gave it the required permissions.</p>
  
  <p>Here is my configuration file:</p>
  
  <pre><code># Names of nodes to start
  #   most people 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"
  #   alternatively, you can specify the number of nodes to start:
  #CELERYD_NODES=10
  
  # Absolute or relative path to the 'celery' command:
  # CELERY_BIN="/usr/local/bin/celery"
  CELERY_BIN="/home/&lt;user&gt;/.virtualenvs/&lt;virtualenv_name&gt;/bin/celery"
  
  # App instance to use
  # comment out this line if you don't use an app
  # CELERY_APP="proj"
  # or fully qualified:
  CELERY_APP="&lt;project_name&gt;.settings:app"
  
  # Where to chdir at start.
  CELERYD_CHDIR="/home/&lt;user&gt;/projects/&lt;project_name&gt;/"
  
  # 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>I have used the process to create the celery user using <a href="https://stackoverflow.com/questions/21880360/daemonizing-celery">this</a> article.</p>
  
  <p>My project is a Django project and I have specified the <code>DJANGO_SETTINGS_MODULE</code> environment variable in the celery setting file as specified in the <a href="http://docs.celeryproject.org/en/latest/tutorials/daemonizing.html" rel="noreferrer">documentation</a> and also in the stackoverflow <a href="https://stackoverflow.com/questions/18092203/celeryd-and-celerybeat-pid-files-are-not-being-created-workers-are-not-starting">answer</a>.</p>
  
  <p>Do I need to change anything in the init.d script or anything else that needs to be added in the celery configuration file... Is it about the celery user that I have created because I also tried specifying </p>
  
  <pre><code>CELERYD_USER = ""
  CELERYD_GROUP = ""
  </code></pre>
  
  <p>while also changing the <code>DEFAULT_USER</code> value to "" in the <code>init.d</code> script.
  Still the issue persisted.</p>
  
  <p>In one of the answers it was also told that there might be some errors in the project... but I did not find any such errors all thanks to my test cases.</p>
  
  <blockquote>
    <p>PS : I have specified ,  and  for privacy issues
    they have their original names.</p>
  </blockquote>