# HG changeset patch # User melissacline # Date 1411528116 25200 # Node ID 733fa93086c5c33d8a481984766535ce2093d6ca # Parent 75c7d80df9c1b63c591b76e7e6d69fa8a732bdc6 Adding the Xena port to the environment variables. Adding an output file diff -r 75c7d80df9c1 -r 733fa93086c5 startXena.py --- a/startXena.py Tue Sep 09 18:48:53 2014 -0700 +++ b/startXena.py Tue Sep 23 20:08:36 2014 -0700 @@ -8,15 +8,10 @@ def stop_err(msg, error_level=1): """Print error message to stdout and quit with given error level.""" sys.stderr.write("%s\n" % msg) - #fp.write("%s\n" % msg) - #fp.write("error code %d\n" % error_level) sys.exit(error_level) def run(cmd): - #Avoid using shell=True when we call subprocess to ensure if the Python - #script is killed, so too is the child process. - print cmd try: child = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) @@ -29,26 +24,24 @@ if stderr and stdout: stop_err("Return code %i from command:\n%s\n\n%s\n\n%s" % (return_code, err, stdout, stderr)) else: - stop_err("Return code %i from command:\n%s\n%s" % (return_code, err, stderr)) + stop_err("Return code %i from command:\n%s" % (return_code, stderr)) def main(): - #parser = argparse.ArgumentParser() - #parser.add_argument("-H", "--host", type=str) - #parser.add_argument("-p", "--port", type=str) - #args = parser.parse_args() - jarPath = os.getenv("JAVA_JAR_PATH", "~") + jarPath = os.getenv("XENA_JAR_PATH", "~") xenaJarPath = os.path.join(jarPath, "xena.jar") xenaBaseDir = os.getenv("XENA_BASE_DIR", "~") - cmdline = "java -jar %s -r %s/files -d %s/db -t %s/tmp >& /inside/home/cline/tmp/xena.errout" % (xenaJarPath, xenaBaseDir, xenaBaseDir, xenaBaseDir) + xenaPort = os.getenv("XENA_PORT", 1236) + cmdline = "java -jar %s -r %s/files -d %s/db -t %s/tmp -p %d" % (xenaJarPath, xenaBaseDir, + xenaBaseDir, xenaBaseDir, + xenaPort) for ii in range(1,len(sys.argv)): cmdline = "%s %s" % (cmdline, sys.argv[ii]) - #fp = open("/inside/home/cline/tmp/xena.out", "w") - #fp.write("cmdline %s\n" % cmdline) - #fp.close() - run(cmdline) + cmd += " &" + print "Xena VM invoked with command", cmdline + subprocess.call(cmd, shell=True) if __name__ == '__main__': main( ) diff -r 75c7d80df9c1 -r 733fa93086c5 tool_dependencies.xml --- a/tool_dependencies.xml Tue Sep 09 18:48:53 2014 -0700 +++ b/tool_dependencies.xml Tue Sep 23 20:08:36 2014 -0700 @@ -4,7 +4,7 @@ - $INSTALL_DIR + $INSTALL_DIR $INSTALL_DIR/xena @@ -12,6 +12,9 @@ $INSTALL_DIR + + 1236 + ${REPOSITORY_INSTALL_DIR}/xena.jar ${INSTALL_DIR} diff -r 75c7d80df9c1 -r 733fa93086c5 xena.xml --- a/xena.xml Tue Sep 09 18:48:53 2014 -0700 +++ b/xena.xml Tue Sep 23 20:08:36 2014 -0700 @@ -4,10 +4,13 @@ installXena - startXena.py -H 0.0.0.0 -p 1236 & + startXena.py -H 0.0.0.0 & >& $outfile; + + + - Press the Execute button to start the Xena VM. + Press the Execute button to start the Xena VM. An output log will indicate if the VM was started successfully.