[Django]-How to Running celeryd as a daemon in ubuntu?

5πŸ‘

βœ…

I am adding a proper answer in order to be clearly visible:

Workers are unix processes that will run the various celery tasks. As you can see in the documentation, the CELERYD_USER and CELERYD_GROUP determine the name of user and group these workers will be run in your Unix environment.

So, what happened initially in your case is that celery tried to start the worker with a user named β€œcelery” which did not exist in your system. When you commented out these two options, then celery started the workers with the user that issued the command sudo /etc/init.d/celeryd start which in this case is the root (administrator) user (default is the current user).

However, it is recommended to run the workers as unpriviledged users and not as root for obvious reasons. So I recommend to actually add the celery user and group using the small tutorial found here http://www.cyberciti.biz/faq/unix-create-user-account/ and uncomment again the

CELERYD_USER="celery"
CELERYD_GROUP="celery"

options.

πŸ‘€Serafeim

Leave a comment