Browse Source

Updated setup_nginx.py to match aspnet

Kevin Howard 11 years ago
parent
commit
33f43e6af2
1 changed files with 10 additions and 1 deletions
  1. 10 1
      servicestack/setup_nginx.py

+ 10 - 1
servicestack/setup_nginx.py

@@ -16,6 +16,7 @@ def start(args):
     # build
     # build
     subprocess.check_call("rm -rf bin obj", shell=True, cwd=app)
     subprocess.check_call("rm -rf bin obj", shell=True, cwd=app)
     subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd=app)
     subprocess.check_call("xbuild /p:Configuration=Release", shell=True, cwd=app)
+    subprocess.check_call("sudo chown -R $USER:$USER /usr/local/etc/mono", shell=True)
     
     
     # nginx
     # nginx
     workers = 'worker_processes ' + str(args.max_threads) + ';'
     workers = 'worker_processes ' + str(args.max_threads) + ';'
@@ -35,5 +36,13 @@ def stop():
   
   
   subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + root + "/nginx.conf -s stop", shell=True)
   subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + root + "/nginx.conf -s stop", shell=True)
   subprocess.check_call("rm -f " + root + "/nginx.upstream.conf", shell=True)
   subprocess.check_call("rm -f " + root + "/nginx.upstream.conf", shell=True)
-  subprocess.check_call("pkill -9 mono", shell=True)
+  #
+  # stop mono
+  #
+  p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+  out, err = p.communicate()
+  for line in out.splitlines():
+    if 'mono-server' in line:
+      pid = int(line.split(None, 2)[1])
+      os.kill(pid, 9)
   return 0
   return 0