daemonizing.rst 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. =============================
  2. Running celeryd as a daemon
  3. =============================
  4. Celery does not daemonize itself, please use one of the following
  5. daemonization tools.
  6. .. contents::
  7. :local:
  8. start-stop-daemon
  9. =================
  10. See the `contrib/debian/init.d/`_ directory in the celery distribution, this
  11. directory contains init scripts for celeryd and celerybeat.
  12. These scripts are configured in ``/etc/default/celeryd``.
  13. .. _`contrib/debian/init.d/`:
  14. http://github.com/ask/celery/tree/master/contrib/debian/
  15. Init script: celeryd
  16. --------------------
  17. :Usage: ``/etc/init.d/celeryd {start|stop|force-reload|restart|try-restart|status}``
  18. :Configuration file: /etc/default/celeryd
  19. To configure celeryd you probably need to at least tell it where to chdir
  20. when it starts (to find your celeryconfig).
  21. Example configuration
  22. ~~~~~~~~~~~~~~~~~~~~~
  23. This is an example configuration for a Python project.
  24. ``/etc/default/celeryd``::
  25. # Where to chdir at start.
  26. CELERYD_CHDIR="/opt/Myproject/"
  27. # Extra arguments to celeryd
  28. CELERYD_OPTS="--time-limit 300"
  29. # Name of the celery config module.#
  30. CELERY_CONFIG_MODULE="celeryconfig"
  31. Example Django configuration
  32. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  33. This is an example configuration for those using ``django-celery``::
  34. # Where the Django project is.
  35. CELERYD_CHDIR="/opt/Project/"
  36. # Name of the projects settings module.
  37. DJANGO_SETTINGS_MODULE="settings"
  38. # Path to celeryd
  39. CELERYD="/opt/Project/manage.py celeryd"
  40. Available options
  41. ~~~~~~~~~~~~~~~~~~
  42. * CELERYD_OPTS
  43. Additional arguments to celeryd, see ``celeryd --help`` for a list.
  44. * CELERYD_CHDIR
  45. Path to chdir at start. Default is to stay in the current directory.
  46. * CELERYD_PIDFILE
  47. Full path to the pidfile. Default is /var/run/celeryd.pid.
  48. * CELERYD_LOGFILE
  49. Full path to the celeryd logfile. Default is /var/log/celeryd.log
  50. * CELERYD_LOG_LEVEL
  51. Log level to use for celeryd. Default is INFO.
  52. * CELERYD
  53. Path to the celeryd program. Default is ``celeryd``.
  54. You can point this to an virtualenv, or even use manage.py for django.
  55. * CELERYD_USER
  56. User to run celeryd as. Default is current user.
  57. * CELERYD_GROUP
  58. Group to run celeryd as. Default is current user.
  59. Init script: celerybeat
  60. -----------------------
  61. :Usage: ``/etc/init.d/celerybeat {start|stop|force-reload|restart|try-restart|status}``
  62. :Configuration file: /etc/default/celerybeat or /etc/default/celeryd
  63. Example configuration
  64. ~~~~~~~~~~~~~~~~~~~~~
  65. This is an example configuration for a Python project:
  66. ``/etc/default/celeryd``::
  67. # Where to chdir at start.
  68. CELERYD_CHDIR="/opt/Myproject/"
  69. # Extra arguments to celeryd
  70. CELERYD_OPTS="--time-limit 300"
  71. # Extra arguments to celerybeat
  72. CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
  73. # Name of the celery config module.#
  74. CELERY_CONFIG_MODULE="celeryconfig"
  75. Example Django configuration
  76. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  77. This is an example configuration for those using ``django-celery``::
  78. # Where the Django project is.
  79. CELERYD_CHDIR="/opt/Project/"
  80. # Name of the projects settings module.
  81. DJANGO_SETTINGS_MODULE="settings"
  82. # Path to celeryd
  83. CELERYD="/opt/Project/manage.py celeryd"
  84. # Path to celerybeat
  85. CELERYBEAT="/opt/Project/manage.py celerybeat"
  86. # Extra arguments to celerybeat
  87. CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
  88. Available options
  89. ~~~~~~~~~~~~~~~~~
  90. * CELERYBEAT_OPTS
  91. Additional arguments to celerybeat, see ``celerybeat --help`` for a
  92. list.
  93. * CELERYBEAT_PIDFILE
  94. Full path to the pidfile. Default is /var/run/celeryd.pid.
  95. * CELERYBEAT_LOGFILE
  96. Full path to the celeryd logfile. Default is /var/log/celeryd.log
  97. * CELERYBEAT_LOG_LEVEL
  98. Log level to use for celeryd. Default is INFO.
  99. * CELERYBEAT
  100. Path to the celeryd program. Default is ``celeryd``.
  101. You can point this to an virtualenv, or even use manage.py for django.
  102. * CELERYBEAT_USER
  103. User to run celeryd as. Default is current user.
  104. * CELERYBEAT_GROUP
  105. Group to run celeryd as. Default is current user.
  106. `supervisord`_
  107. ==============
  108. * `contrib/supervisord/`_
  109. .. _`contrib/supervisord/`:
  110. http://github.com/ask/celery/tree/master/contrib/supervisord/
  111. .. _`supervisord`: http://supervisord.org/
  112. launchd (OS X)
  113. ==============
  114. * `contrib/mac/`_
  115. .. _`contrib/mac/`:
  116. http://github.com/ask/celery/tree/master/contrib/mac/