Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to run automatically celery at startup?

Tags:

django

celery

I have python server based on django and celery. Each time computer restarts, apache2 starts so my server is working, BUT I have to restart celery manually (going to my project directory and executing "python manage.py celeryd"). What is the correct solution for production? I mean, is there a possibility to start celery as daemon?

Here http://github.com/ask/celery/tree/master/contrib/debian/init.d/ I found two scripts which looks like they should be in /etc/init.d/ like apache2 script that starts apache2. But I put them to /etc/init.d/ and as I see nothing changes.

like image 563
Graf Avatar asked Feb 18 '10 20:02

Graf


1 Answers

You should take a look at http://www.debian-administration.org/article/Making_scripts_run_at_boot_time_with_Debian

In short, with the celeryd script in /etc/init.d:

$ update-rc.d celeryd defaults
Adding system startup for /etc/init.d/celeryd ...
    /etc/rc0.d/K20celeryd -> ../init.d/celeryd
    /etc/rc1.d/K20celeryd -> ../init.d/celeryd
    /etc/rc6.d/K20celeryd -> ../init.d/celeryd
    /etc/rc2.d/S20celeryd -> ../init.d/celeryd
    /etc/rc3.d/S20celeryd -> ../init.d/celeryd
    /etc/rc4.d/S20celeryd -> ../init.d/celeryd
    /etc/rc5.d/S20celeryd -> ../init.d/celeryd
like image 50
asksol Avatar answered Sep 28 '22 11:09

asksol