Browse Source

wsgi: Don't use shell to launch gunicorn.

INADA Naoki 12 years ago
parent
commit
4786d7524a
1 changed files with 8 additions and 3 deletions
  1. 8 3
      wsgi/setup.py

+ 8 - 3
wsgi/setup.py

@@ -10,9 +10,13 @@ proc = None
 
 
 
 
 def start(args):
 def start(args):
-    proc = subprocess.Popen(
-        bin_dir + "/gunicorn hello:app -k meinheld.gmeinheld.MeinheldWorker -b 0.0.0.0:8080 -w " +
-        str(NCPU) + " --preload --log-level=critical", shell=True, cwd="wsgi")
+    proc = subprocess.Popen([
+        bin_dir + "/gunicorn", "hello:app",
+        "-k", "meinheld.gmeinheld.MeinheldWorker",
+        "-b", "0.0.0.0:8080",
+        '-w', str(NCPU),
+        "--log-level=critical"],
+        cwd="wsgi")
     return 0
     return 0
 
 
 def stop():
 def stop():
@@ -20,5 +24,6 @@ def stop():
     if proc is None:
     if proc is None:
         return 0
         return 0
     proc.terminate()
     proc.terminate()
+    proc.wait()
     proc = None
     proc = None
     return 0
     return 0