setup_py3.py 425 B

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