Browse Source

fix nginx on dancer plack and web-simple (hopefully)

Joel Berger 11 years ago
parent
commit
75f8dfecca
4 changed files with 8 additions and 4 deletions
  1. 2 1
      dancer/nginx.conf
  2. 2 0
      plack/nginx.conf
  3. 2 2
      plack/setup.py
  4. 2 1
      web-simple/nginx.conf

+ 2 - 1
dancer/nginx.conf

@@ -1,4 +1,5 @@
-user tfb;
+# Replaced by setup.py
+user USR;
 error_log stderr error;
 error_log stderr error;
 
 
 worker_processes 2;
 worker_processes 2;

+ 2 - 0
plack/nginx.conf

@@ -1,3 +1,5 @@
+# Replaced by setup.py
+user USR;
 error_log stderr error;
 error_log stderr error;
 pid        /tmp/nginx.pid;
 pid        /tmp/nginx.pid;
 worker_processes 4;
 worker_processes 4;

+ 2 - 2
plack/setup.py

@@ -11,14 +11,14 @@ def start(args, logfile, errfile):
   setup_util.replace_text("plack/nginx.conf", "server unix:.*\/FrameworkBenchmarks", "server unix:" + arg.fwroot)
   setup_util.replace_text("plack/nginx.conf", "server unix:.*\/FrameworkBenchmarks", "server unix:" + arg.fwroot)
   try:
   try:
     subprocess.Popen("start_server --backlog=16384 --pid-file=$TROOT/app.pid --path=$TROOT/app.sock -- plackup -E production -s Starlet --max-keepalive-reqs 1000 --max-reqs-per-child 50000 --min-reqs-per-child 40000 --max-workers=" + str(args.max_threads+4) + " -a $TROOT/app.psgi", shell=True, cwd="plack", stderr=errfile, stdout=logfile)
     subprocess.Popen("start_server --backlog=16384 --pid-file=$TROOT/app.pid --path=$TROOT/app.sock -- plackup -E production -s Starlet --max-keepalive-reqs 1000 --max-reqs-per-child 50000 --min-reqs-per-child 40000 --max-workers=" + str(args.max_threads+4) + " -a $TROOT/app.psgi", shell=True, cwd="plack", stderr=errfile, stdout=logfile)
-    subprocess.check_call("/usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf", shell=True,stderr=errfile, stdout=logfile)
+    subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf", shell=True,stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1
 def stop(logfile, errfile):
 def stop(logfile, errfile):
   try:
   try:
     subprocess.call('kill -TERM $(cat $TROOT/app.pid)', shell=True, stderr=errfile, stdout=logfile)
     subprocess.call('kill -TERM $(cat $TROOT/app.pid)', shell=True, stderr=errfile, stdout=logfile)
-    subprocess.call("/usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -s stop", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.call("sudo /usr/local/nginx/sbin/nginx -c $TROOT/nginx.conf -s stop", shell=True, stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1

+ 2 - 1
web-simple/nginx.conf

@@ -1,4 +1,5 @@
-user tfb;
+# Replaced by setup.py
+user USR;
 error_log stderr error;
 error_log stderr error;
 
 
 worker_processes 2;
 worker_processes 2;