title: Celery not running (Permission Denied)
body: <p>I'm not running a Django Project, this is just a simple python project and I want to demonize the celery. Initially I was running it in the shell. Celery sometimes hangs in between(known issue). Hence I need to restart it again and again. Therefore, I need to daemonize it, so that I can run a script that restarts the celery on its own via a cronjob. </p>
  
  <p>I've looked onto various <a href="https://stackoverflow.com/questions/22736808/celery-daemon-permission-denied-on-log-file">threads</a> on SO, but with no luck.</p>
  
  <p>I've created a user and group , both named as  <code>celery</code> by following commands:-</p>
  
  <pre><code>sudo groupadd celery
  sudo useradd -g celery celery
  </code></pre>
  
  <p>I created this file as: <strong>/etc/default/celeryd</strong></p>
  
  <pre><code>CELERYD_NODES="w1"
  
  CELERY_BIN="/usr/local/bin/celery"
  
  CELERY_APP="tasks"
  
  CELERYD_CHDIR="/home/cube26/Desktop/cube26/c26-quicklook"
  
  CELERYD_OPTS="--time-limit=300 --concurrency=8  -Q BBC,BGR,FASTCOMPANY"
  
  CELERY_CONFIG_MODULE="celeryconfig" #I dont know what this is for?
  
  CELERYD_LOG_FILE="/var/log/celery/%n.log"
  CELERYD_PID_FILE="/var/run/celery/%n.pid"
  
  CELERY_CREATE_DIRS=1
  
  CELERYD_USER="celery"
  CELERYD_GROUP="celery"
  </code></pre>
  
  <p>Then downloaded <a href="https://raw.githubusercontent.com/celery/celery/3.1/extra/generic-init.d/celeryd" rel="noreferrer">this</a> file and kept it inside  <strong>/etc/init.d/celeryd</strong>.</p>
  
  <p>Then <code>chmod +x /etc/init.d/celeryd</code> to make it executable.</p>
  
  <p>Thats all I did. </p>
  
  <p>and I'm still getting an error saying <code>IOError: [Errno 13] Permission denied: '/var/log/celery/w1.log'</code></p>
  
  <p>What wrong am I doing? Please help me rectify it.</p>