!7 sbool preserveEnvironment = true; sS javaxOptions = "-verbose -dontcompilethroughport5000"; p { if (hasSuperUserVM()) { print("Super User VM already running!"); ret; } doIt(); cleanKill(); } svoid doIt ctex { if (!isOnPATH("x-terminal-emulator")) fail("x-terminal-emulator not on PATH. Your Linux is weird"); //File outFile = File.createTempFile("suvm_", ".out"); File outFile = newFile("/tmp/" + now() + ".log"); S msg = "Starting JavaX Super User VM..."; // the actual command executed as root S cmd3 = "whoami; nohup " + relativeCmdToAbsoluteUsingPath(_javaCommand()) + " " + javaxDefaultVMArgs() + " -jar " + pathToJavaxJar() + " " + appendSpaceIfNempty(javaxOptions) + psI(#1009053) + " " + bashQuote(userHome()) + " >" + bashQuote(outFile) + " 2>&1 &"; print(+cmd3); S cmd2 = "echo " + bashQuote(msg) + "; echo; sudo " + (preserveEnvironment ? "-E " : "") + "/bin/bash -c " + bashQuote(cmd3) + "; sleep 2"; print(+cmd2); S cmd = "/bin/bash -c " + bashQuote(cmd2); print(+cmd); nohup("x-terminal-emulator -e " + bashQuote(cmd)); print("\nWatch " + outFile + " to check progress"); }