|
@@ -5,16 +5,14 @@ from os.path import expanduser
|
|
import os
|
|
import os
|
|
import getpass
|
|
import getpass
|
|
|
|
|
|
-home = expanduser("~")
|
|
|
|
-
|
|
|
|
def start(args, logfile, errfile):
|
|
def start(args, logfile, errfile):
|
|
setup_util.replace_text("kelp/app.pl", "localhost", ""+ args.database_host +"")
|
|
setup_util.replace_text("kelp/app.pl", "localhost", ""+ args.database_host +"")
|
|
setup_util.replace_text("kelp/nginx.conf", "USR", getpass.getuser())
|
|
setup_util.replace_text("kelp/nginx.conf", "USR", getpass.getuser())
|
|
- setup_util.replace_text("kelp/nginx.conf", "server unix:.*\/FrameworkBenchmarks", "server unix:" + home + "/FrameworkBenchmarks")
|
|
|
|
|
|
+ setup_util.replace_text("kelp/nginx.conf", "server unix:.*\/FrameworkBenchmarks", "server unix:" + args.fwroot)
|
|
|
|
|
|
try:
|
|
try:
|
|
- subprocess.Popen("plackup -E production -s Starman --workers=" + str(args.max_threads) + " -l " + home + "/FrameworkBenchmarks/kelp/frameworks-benchmark.sock -a ./app.pl", shell=True, cwd="kelp", stderr=errfile, stdout=logfile)
|
|
|
|
- subprocess.check_call("sudo /usr/local/nginx/sbin/nginx -c " + home + "/FrameworkBenchmarks/kelp/nginx.conf", shell=True, stderr=errfile, stdout=logfile)
|
|
|
|
|
|
+ subprocess.Popen("plackup -E production -s Starman --workers=" + str(args.max_threads) + " -l $TROOT/frameworks-benchmark.sock -a $TROOT/app.pl", shell=True, cwd="kelp", 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
|