Is it possible to run automatically celery at startup?
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://git开发者_Python百科hub.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.
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
精彩评论