瀏覽代碼

Added section about daemonizing as root.

Daniel Devine 8 年之前
父節點
當前提交
358d57d500
共有 1 個文件被更改,包括 18 次插入0 次删除
  1. 18 0
      docs/tutorials/daemonizing.rst

+ 18 - 0
docs/tutorials/daemonizing.rst

@@ -478,6 +478,24 @@ This is an example configuration for those using :pypi:`django-celery`:
 To add an environment variable such as :envvar:`DJANGO_SETTINGS_MODULE`
 use the Environment in :file:`celery.service`.
 
+Daemonizing as root
+======================================================================
+It is not best practice to daemonize as the root user. There should always
+be a workaround to avoid running as root. Celery may run arbitrary code
+in messages serialized with pickle - which is dangerous, especially if
+run as root.
+
+By default Celery will not run workers as root. The associated error
+message may not be visible in the logs but may be seen if :envvar:`C_FAKEFORK`
+is used.
+
+To force Celery to run workers as root use :envvar:`C_FORCE_ROOT`.
+
+When running as root without :envvar:`C_FORCE_ROOT` the worker will
+appear to start with *"OK"* but exit immediately after with no apparent
+errors. This problem may appear when running the project in a new devleopment
+or deployment environment (inadvertently) as root.
+
 .. _daemon-supervisord:
 
 :pypi:`supervisor`