فهرست منبع

CELERYD option to the init script should not be used for the generic ones

Ask Solem 13 سال پیش
والد
کامیت
8f4706fd0e
2فایلهای تغییر یافته به همراه12 افزوده شده و 13 حذف شده
  1. 6 3
      contrib/generic-init.d/celeryd
  2. 6 10
      docs/cookbook/daemonizing.rst

+ 6 - 3
contrib/generic-init.d/celeryd

@@ -94,17 +94,20 @@
 # Short-Description: celery task worker daemon
 ### END INIT INFO
 
-set -e
+#set -e
 
 DEFAULT_PID_FILE="/var/run/celeryd@%n.pid"
 DEFAULT_LOG_FILE="/var/log/celeryd@%n.log"
-DEFAULT_CELERYD="celeryd"
 DEFAULT_LOG_LEVEL="INFO"
 DEFAULT_NODES="celery"
+DEFAULT_CELERYD="-m celery.bin.celeryd_detach"
 
 # /etc/init.d/celeryd: start and stop the celery task worker daemon.
 
-if test -f /etc/default/celeryd; then
+CELERY_DEFAULTS=${CELERY_DEFAULTS:-"/etc/default/celeryd"}
+
+test -f "$CELERY_DEFAULTS" && . "$CELERY_DEFAULTS"
+if [ -f "/etc/default/celeryd" ]; then
     . /etc/default/celeryd
 fi
 

+ 6 - 10
docs/cookbook/daemonizing.rst

@@ -150,13 +150,10 @@ Example configuration
 
 This is an example configuration for a Python project:
 
-`/etc/default/celeryd`::
+`/etc/default/celerybeat`::
 
     # Where to chdir at start.
-    CELERYD_CHDIR="/opt/Myproject/"
-
-    # Extra arguments to celeryd
-    CELERYD_OPTS="--time-limit=300"
+    CELERYBEAT_CHDIR="/opt/Myproject/"
 
     # Extra arguments to celerybeat
     CELERYBEAT_OPTS="--schedule=/var/run/celerybeat-schedule"
@@ -169,17 +166,16 @@ This is an example configuration for a Python project:
 Example Django configuration
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-This is an example configuration for those using `django-celery`::
+This is an example configuration for those using `django-celery`
+
+`/etc/default/celerybeat`::
 
     # Where the Django project is.
-    CELERYD_CHDIR="/opt/Project/"
+    CELERYBEAT_CHDIR="/opt/Project/"
 
     # Name of the projects settings module.
     export DJANGO_SETTINGS_MODULE="settings"
 
-    # Path to celeryd
-    CELERYD="/opt/Project/manage.py celeryd"
-
     # Path to celerybeat
     CELERYBEAT="/opt/Project/manage.py celerybeat"