Browse Source

Stop mono correctly in nancy test.

Michael Hixson 12 years ago
parent
commit
1d44c562cd
1 changed files with 9 additions and 1 deletions
  1. 9 1
      nancy/setup_nginx.py

+ 9 - 1
nancy/setup_nginx.py

@@ -35,5 +35,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-sgen", 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