|
@@ -6,6 +6,7 @@ from os import kill
|
|
|
python = expanduser('~/FrameworkBenchmarks/installs/py2/bin/python')
|
|
|
cwd = expanduser('~/FrameworkBenchmarks/tornado')
|
|
|
|
|
|
+
|
|
|
def start(args, logfile, errfile):
|
|
|
setup_util.replace_text(
|
|
|
cwd + "/server.py", "localhost", args.database_host)
|
|
@@ -16,10 +17,8 @@ def start(args, logfile, errfile):
|
|
|
return 0
|
|
|
|
|
|
def stop(logfile, errfile):
|
|
|
- p = subprocess.Popen(['ps', 'aux'], stdout=subprocess.PIPE)
|
|
|
- out, err = p.communicate()
|
|
|
- for line in out.splitlines():
|
|
|
- if 'FrameworkBenchmarks/installs/py2/bin/python server.py --port=8080 --logging=error' in line:
|
|
|
- pid = int(line.split(None,2)[1])
|
|
|
- kill(pid, 9)
|
|
|
+ for line in subprocess.check_output("ps aux"):
|
|
|
+ if 'FrameworkBenchmarks/installs/py2/bin/python server.py --port=8080 --logging=error' in line:
|
|
|
+ pid = int(line.split(None,2)[1])
|
|
|
+ kill(pid, 9)
|
|
|
return 0
|