title: django celery daemon does work: it can't create pid file
body: <p>I can't init mi celeryd and celerybeat service, I used the same code on another enviroment (configuring everything from the start) but here don't work. I think this was by permissions but I could'nt run it. please help me.</p>
  
  <p>this is my celery conf on settings.py</p>
  
  <pre><code>CELERY_RESULT_BACKEND = ‘djcelery.backends.database:DatabaseBackend’
  CELERY_BROKER_URL = ‘amqp://localhost’
  CELERY_ACCEPT_CONTENT = [‘json’]
  CELERY_TASK_SERIALIZER = ‘json’
  CELERY_RESULT_SERIALIZER = ‘json’
  CELERYBEAT_SCHEDULER =  ‘djcelery.schedulers.DatabaseScheduler’
  CELERY_ENABLE_UTC = True
  CELERY_TIMEZONE = TIME_ZONE  # ‘America/Lima’
  CELERY_BEAT_SCHEDULE= {}
  </code></pre>
  
  <p>this is my file /etc/init.d/celeryd</p>
  
  <pre><code>https://github.com/celery/celery/blob/master/extra/generic-init.d/celeryd 
  </code></pre>
  
  <p>then I use</p>
  
  <pre><code>sudo chmod 755 /etc/init.d/celeryd
  sudo chown admin1:admin1 /etc/init.d/celeryd
  </code></pre>
  
  <p>and I created /etc/default/celeryd</p>
  
  <pre><code>CELERY_BIN="/home/admin1/Env/tos/bin/celery"
  
  # App instance to use
  CELERY_APP="tos"
  
  # Where to chdir at start.
  CELERYD_CHDIR="/home/admin1/webapps/tos/"
  
  # 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%I.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="admin1"
  CELERYD_GROUP="admin1"
  
  # If enabled pid and log directories will be created if missing,
  # and owned by the userid/group configured.
  CELERY_CREATE_DIRS=1
  
  export SECRET_KEY="foobar"
  </code></pre>
  
  <p>for celerybeat I create a file on /etc/init.d/celerybeat
   with:</p>
  
  <pre><code>https://github.com/celery/celery/blob/master/extra/generic-init.d/celerybeat
  </code></pre>
  
  <p>and start service like this:</p>
  
  <pre><code>sudo /etc/init.d/celeryd start
  sudo /etc/init.d/celerybeat start
  </code></pre>
  
  <p>and I have this error: </p>
  
  <pre><code>sudo: imposible resolver el anfitrión SIO
  celery init v10.1.
  Using config script: /etc/default/celeryd
  celery multi v3.1.25 (Cipater)
  &gt; Starting nodes...
      &gt; celery@SIO-PRODUCION: OK
  ERROR: Pidfile (celery.pid) already exists.
  Seems we're already running? (pid: 30198)
  /etc/init.d/celeryd: 515: /etc/init.d/celeryd: --pidfile=/var/run/celery/%n.pid: not found
  </code></pre>
  
  <p>I also I got it when check it with :</p>
  
  <pre><code>sudo C_FAKEFORK=1 sh -x /etc/init.d/celeryd start
  some data .....
  
  
  starting nodes...
  ERROR: Pidfile (celery.pid) already exists.
  Seems we're already running? (pid: 30198)
      &gt; celery@SIO-PRODUCION: * Child terminated with errorcode 73
  FAILED
  + --pidfile=/var/run/celery/%n.pid
  /etc/init.d/celeryd: 515: /etc/init.d/celeryd: --pidfile=/var/run/celery/%n.pid: not found
  + --logfile=/var/log/celery/%n%I.log
  /etc/init.d/celeryd: 517: /etc/init.d/celeryd: --logfile=/var/log/celery/%n%I.log: not found
  + --loglevel=INFO
  /etc/init.d/celeryd: 519: /etc/init.d/celeryd: --loglevel=INFO: not found
  + --app=tos
  /etc/init.d/celeryd: 521: /etc/init.d/celeryd: --app=tos: not found
  + --time-limit=300 --concurrency=8
  /etc/init.d/celeryd: 523: /etc/init.d/celeryd: --time-limit=300: not found
  + exit 0
  </code></pre>