title: How to setup celery as daemon
body: <p>I am faced with necessity to setup celery as daemon for my django project on Ubuntu 16.04 server while doing it I met several misunderstandings which I will describe in my question. I know that by the rules of Stack asked should should ask only one clear question but I will ask several in one question because first question come from second etc.  </p>
  
  <p>For tune celery as daemon I decide to use <code>SystemD</code>.  In documentation <a href="http://docs.celeryproject.org/en/latest/userguide/daemonizing.html#daemonizing" rel="nofollow noreferrer">Demonization celery</a> provide a guide but it isn't so clear as I want maybe it's because I am beginner. My first question is: should I setup separately celery and celerybeat? 
  Here is  documentation provided example of configuration </p>
  
  <pre><code>[Unit] 
  Description=Celery Service    
  After=network.target 
  
  [Service] 
  Type=forking 
  User=celery 
  Group=celery 
  EnvironmentFile=/etc/conf.d/celery 
  WorkingDirectory=/opt/celery 
  ExecStart=/bin/sh -c '${CELERY_BIN}    multi start ${CELERYD_NODES} \ -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \ --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}' 
  ExecStop=/bin/sh -c '${CELERY_BIN} multi stopwait ${CELERYD_NODES} \ --pidfile=${CELERYD_PID_FILE}'  
  ExecReload=/bin/sh -c '${CELERY_BIN} multi restart ${CELERYD_NODES} \ -A ${CELERY_APP} --pidfile=${CELERYD_PID_FILE} \ --logfile=${CELERYD_LOG_FILE} --loglevel=${CELERYD_LOG_LEVEL} ${CELERYD_OPTS}' 
  
  [Install] WantedBy=multi-user.target
  </code></pre>
  
  <p>All my misunderstandings relate to this piece of code and next question is: </p>
  
  <p>What <code>user</code> and <code>group</code> I should specify in Service part of configuration? in documentation example above celery specified for user and group but when I checked users and groups on my Ubuntu I haven't celery user and group should I create this kind of user and group if answer is yes what rights I should provide for celery user and group?  Or I should specify in user and group settings my Ubuntu user under which I am working on server?  </p>
  
  <p>Next question is related to all variables which used to specify different parts of settings for example in above configuration example in <code>ExecStart</code> settings have multiple variables </p>
  
  <pre><code>${CELERY_BIN}   
  ${CELERYD_NODES} 
  ${CELERY_APP} 
  ${CELERYD_PID_FILE} 
  ${CELERYD_LOG_FILE} 
  ${CELERYD_LOG_LEVEL} 
  ${CELERYD_OPTS}' 
  </code></pre>
  
  <p>Where I should specify this variables I think that it should be in django <code>settings.py</code> file but documentation above provide example which confused me maybe you can think why I can't to try configure this variables in settings.py rather than asking it here but I can't to test it because I don't have understanding about user and group question </p>
  
  <p>Next question is about this setting</p>
  
  <pre><code>EnvironmentFile=/etc/conf.d/celery
  </code></pre>
  
  <p>What I should specify here because I have not this file on my system?  Should I create it?  It's seems that is default settings for celery but I use django and all related settings to celery I specified in my django project settings.py file </p>
  
  <p>Can anyone guide me?  Thank in advance </p>