Browse Source

master hhvm was not terminating correctly

Mike Smith 11 years ago
parent
commit
86b99ccbdd
1 changed files with 7 additions and 2 deletions
  1. 7 2
      hhvm/setup.py

+ 7 - 2
hhvm/setup.py

@@ -16,7 +16,7 @@ def start(args, logfile, errfile):
     if os.name == 'nt':
     if os.name == 'nt':
       # Not supported !
       # Not supported !
       return 0
       return 0
-    subprocess.check_call("sudo hhvm --config " + home + "/FrameworkBenchmarks/hhvm/deploy/config.hdf -m daemon", shell=True, stderr=errfile, stdout=logfile)
+    subprocess.check_call("hhvm --config " + home + "/FrameworkBenchmarks/hhvm/deploy/config.hdf -m daemon", shell=True, stderr=errfile, stdout=logfile)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1
@@ -25,7 +25,12 @@ def stop(logfile, errfile):
     if os.name == 'nt':
     if os.name == 'nt':
       # Not Supported !
       # Not Supported !
       return 0
       return 0
-    subprocess.call("sudo kill -QUIT $( cat hhvm/hhvm.pid )", shell=True, stderr=errfile, stdout=logfile)
+    p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
+    out, err = p.communicate()
+    for line in out.splitlines():
+      if 'hhvm' in line and 'toolset' not in line:
+        pid = int(line.split(None,2)[1])
+        os.kill(pid,15)
     return 0
     return 0
   except subprocess.CalledProcessError:
   except subprocess.CalledProcessError:
     return 1
     return 1