setup_py3.py 407 B

123456789101112131415161718
  1. import os
  2. import subprocess
  3. CWD = os.path.dirname(__file__)
  4. def start(args, logfile, errfile):
  5. subprocess.Popen(
  6. "$PY3_GUNICORN app:app -c gunicorn_conf.py",
  7. cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
  8. return 0
  9. def stop(logfile, errfile):
  10. subprocess.call(
  11. "kill `cat gunicorn.pid`",
  12. cwd=CWD, stderr=errfile, stdout=logfile, shell=True)
  13. return 0