Browse Source

18938 Missing errfile argument

Mike Smith 11 years ago
parent
commit
e2b60088cc
2 changed files with 12 additions and 10 deletions
  1. 6 5
      uwsgi/setup_nginx.py
  2. 6 5
      wsgi/setup_nginxuwsgi.py

+ 6 - 5
uwsgi/setup_nginx.py

@@ -6,7 +6,7 @@ bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
 config_dir = os.path.expanduser('~/FrameworkBenchmarks/config')
 NCPU = multiprocessing.cpu_count()
 
-def start(args, logfile):
+def start(args, logfile, errfile):
     try:
         subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c ' +
             config_dir + '/nginx_uwsgi.conf', shell=True)
@@ -15,12 +15,13 @@ def start(args, logfile):
         subprocess.Popen(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi.ini' +
             ' --processes ' + str(NCPU) +
             ' --gevent 1000 --wsgi hello',
-            shell=True, cwd='uwsgi')
+            shell=True, cwd='uwsgi',
+            stdout=logfile, stderr=errfile)
         return 0
     except subprocess.CalledProcessError:
         return 1
 
-def stop(logfile):
-    subprocess.call('sudo /usr/local/nginx/sbin/nginx -s stop', shell=True)
-    subprocess.call(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi_stop.ini', shell=True)
+def stop(logfile, errfile):
+    subprocess.call('sudo /usr/local/nginx/sbin/nginx -s stop', shell=True, stdout=logfile, stderr=errfile)
+    subprocess.call(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi_stop.ini', shell=True, stdout=logfile, stderr=errfile)
     return 0

+ 6 - 5
wsgi/setup_nginxuwsgi.py

@@ -6,7 +6,7 @@ bin_dir = os.path.expanduser('~/FrameworkBenchmarks/installs/py2/bin')
 config_dir = os.path.expanduser('~/FrameworkBenchmarks/config')
 NCPU = multiprocessing.cpu_count()
 
-def start(args, logfile):
+def start(args, logfile, errfile):
     try:
         subprocess.check_call('sudo /usr/local/nginx/sbin/nginx -c ' +
             config_dir + '/nginx_uwsgi.conf', shell=True)
@@ -14,12 +14,13 @@ def start(args, logfile):
         subprocess.Popen(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi.ini' +
             ' --processes ' + str(NCPU) +
             ' --wsgi hello:app',
-            shell=True, cwd='wsgi')
+            shell=True, cwd='wsgi',
+            stdout=logfile, stderr=errfile)
         return 0
     except subprocess.CalledProcessError:
         return 1
 
-def stop(logfile):
-    subprocess.call('sudo /usr/local/nginx/sbin/nginx -s stop', shell=True)
-    subprocess.call(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi_stop.ini', shell=True)
+def stop(logfile, errfile):
+    subprocess.call('sudo /usr/local/nginx/sbin/nginx -s stop', shell=True, stdout=logfile, stderr=errfile)
+    subprocess.call(bin_dir + '/uwsgi --ini ' + config_dir + '/uwsgi_stop.ini', shell=True, stdout=logfile, stderr=errfile)
     return 0