Commit f58c45f7 authored by ibuler's avatar ibuler

[Update] 修改run celery

parent 84fa7b5f
......@@ -66,15 +66,9 @@ def start_celery():
# Todo: Must set this environment, otherwise not no ansible result return
os.environ.setdefault('PYTHONOPTIMIZE', '1')
if platform.platform().startswith("Linux"):
cmd = """
id jumpserver || useradd -s /sbin/nologin jumpserver;
su jumpserver -c 'celery -A common worker -l {}';
""".format(LOG_LEVEL.lower())
else:
cmd = """
export C_FORCE_ROOT=1;celery -A common worker -l {}
""".format(LOG_LEVEL.lower())
cmd = """
export C_FORCE_ROOT=1;celery -A common worker -l {}
""".format(LOG_LEVEL.lower())
p = subprocess.Popen(cmd, shell=True, stdout=sys.stdout, stderr=sys.stderr)
return p
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment