浏览代码

Adds C_FAKEFORK envvar for simple init script/multi debugging

This means that you can now do:

    C_FAKEFORK=1 celery multi start 10

or

    C_FAKEFORK=1 /etc/init.d/celeryd start

to avoid the daemonization step to see errors that are not visible
due to missing stdout/stderr.

Conflicts:
	celery/bin/celeryd_detach.py
Ask Solem 11 年之前
父节点
当前提交
d24dfefdd6
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      celery/bin/celeryd_detach.py

+ 3 - 0
celery/bin/celeryd_detach.py

@@ -26,6 +26,8 @@ from celery.bin.base import daemon_options, Option
 
 logger = get_logger(__name__)
 
+C_FAKEFORK = os.environ.get('C_FAKEFORK')
+
 OPTION_LIST = daemon_options(default_pidfile='celeryd.pid') + (
     Option('--fake',
            default=False, action='store_true', dest='fake',
@@ -35,6 +37,7 @@ OPTION_LIST = daemon_options(default_pidfile='celeryd.pid') + (
 
 def detach(path, argv, logfile=None, pidfile=None, uid=None,
            gid=None, umask=0, working_directory=None, fake=False, ):
+    fake = 1 if C_FAKEFORK else fake
     with detached(logfile, pidfile, uid, gid, umask, working_directory, fake):
         try:
             os.execv(path, [path] + argv)