!7 sbool preserveEnvironment = true; 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"); S msg = "Starting JavaX Super User VM..."; S cmd3 = "nohup " + _javaCommand() + " " + javaxDefaultVMArgs() + " -jar " + pathToJavaxJar() + " " + psI(#1009053) + " " + bashQuote(userHome()) + " >" + bashQuote(outFile) + " 2>&1 &"; S cmd2 = "echo " + bashQuote(msg) + "; echo; sudo " + (preserveEnvironment ? "-E " : "") + "/bin/bash -c " + bashQuote(cmd3) + "; sleep 2"; S cmd = "/bin/bash -c " + bashQuote(cmd2); print(cmd); nohup("x-terminal-emulator -e " + bashQuote(cmd)); print("\nWatch " + outFile + " to check progress"); }