|
@@ -4,13 +4,13 @@ import setup_util
|
|
import os
|
|
import os
|
|
|
|
|
|
def start(args, logfile, errfile):
|
|
def start(args, logfile, errfile):
|
|
- setup_util.replace_text("openresty/nginx.conf", "CWD", os.getcwd())
|
|
|
|
|
|
+ setup_util.replace_text("openresty/nginx.conf", "CWD", args.troot)
|
|
setup_util.replace_text("openresty/app.lua", "DBHOSTNAME", args.database_host)
|
|
setup_util.replace_text("openresty/app.lua", "DBHOSTNAME", args.database_host)
|
|
- subprocess.Popen('sudo /usr/local/openresty/nginx/sbin/nginx -c `pwd`/nginx.conf -g "worker_processes ' + str((args.max_threads)) + ';"', shell=True, cwd="openresty", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
+ subprocess.Popen('sudo /usr/local/openresty/nginx/sbin/nginx -c $TROOT/nginx.conf -g "worker_processes ' + str((args.max_threads)) + ';"', shell=True, cwd="openresty", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
return 0
|
|
return 0
|
|
|
|
|
|
def stop(logfile, errfile):
|
|
def stop(logfile, errfile):
|
|
- subprocess.Popen('sudo /usr/local/openresty/nginx/sbin/nginx -c `pwd`/nginx.conf -s stop', shell=True, cwd="openresty", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
+ subprocess.Popen('sudo /usr/local/openresty/nginx/sbin/nginx -c $TROOT/nginx.conf -s stop', shell=True, cwd="openresty", stderr=errfile, stdout=logfile)
|
|
|
|
|
|
return 0
|
|
return 0
|