fix недоделки с одиночным запуском. стояла ожидающая команда. v++
This commit is contained in:
@@ -30,7 +30,7 @@ public class RemoteCompilationSupervisor extends RemoteTaskSupervisor<Compilatio
|
||||
}
|
||||
@Override
|
||||
protected void StartTask() throws Exception {
|
||||
pass.user.connection.performScript(getRemoteProject(), getStartCommand()+" 1>PID");
|
||||
pass.user.connection.performScriptNoWait(getRemoteProject(), getStartCommand()+" 1>PID");
|
||||
RemoteFile PID = getPID();
|
||||
while (!pass.user.connection.Exists(PID)){
|
||||
System.out.println("PID NOT FOUND");
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ServerRunSupervisor extends RemoteTaskSupervisor<RunTask> {
|
||||
String res = "./run";
|
||||
String env = String.join(" ", Current.getRunConfiguration().getEnvList());
|
||||
if (!env.isEmpty()) res = env + " " + res;
|
||||
pass.user.connection.performScript(getRemoteProject(), "ulimit -s unlimited", res+" 1>PID");
|
||||
pass.user.connection.performScriptNoWait(getRemoteProject(), "ulimit -s unlimited", res+" 1>PID");
|
||||
RemoteFile PID = getPID();
|
||||
while (!pass.user.connection.Exists(PID)){
|
||||
System.out.println("PID NOT FOUND");
|
||||
|
||||
@@ -62,7 +62,7 @@ public class Visualiser extends Component {
|
||||
//http://www.seostella.com/ru/article/2012/02/05/formatirovanie-daty-v-java.html
|
||||
@Override
|
||||
public void GetVersionInfo() {
|
||||
version = 1088;
|
||||
version = 1089;
|
||||
String pattern = "MMM dd yyyy HH:mm:ss";
|
||||
DateFormat df = new SimpleDateFormat(pattern, Locale.ENGLISH);
|
||||
date_text = df.format(getClassBuildTime());
|
||||
|
||||
@@ -182,7 +182,7 @@ public class DVMTestingPlanner extends TestingPlanner<DVMPackage> {
|
||||
@Override
|
||||
protected void PackageStart() throws Exception {
|
||||
String plannerStartCommand = String.join(" ", "nohup", Utils.DQuotes(getPlanner()), Utils.DQuotes(user.workspace), Utils.DQuotes(packageRemoteWorkspace.full_name), Utils.DQuotes(testingPackage.kernels), Utils.DQuotes(testingPackage.drv), "&");
|
||||
user.connection.CommandNoRead("ulimit -s unlimited",plannerStartCommand);
|
||||
user.connection.CommandNoWait("ulimit -s unlimited",plannerStartCommand);
|
||||
RemoteFile PID = new RemoteFile(packageRemoteWorkspace, "PID");
|
||||
RemoteFile STARTED = new RemoteFile(packageRemoteWorkspace, "STARTED");
|
||||
while (!user.connection.Exists(STARTED)) {
|
||||
|
||||
@@ -115,7 +115,6 @@ public class UserConnection {
|
||||
//--
|
||||
//todo из за мусора результатом пользоваться в общем случае невозможно.
|
||||
//следует перенаправлять вывод в какой нибудь временный файл на сервере.
|
||||
|
||||
/*
|
||||
public String ShellCommand(String command) throws Exception {
|
||||
StringBuilder result = new StringBuilder();
|
||||
@@ -406,7 +405,7 @@ public class UserConnection {
|
||||
}
|
||||
execChannel.disconnect();
|
||||
}
|
||||
public void CommandNoRead(String... commands) throws Exception {
|
||||
public void CommandNoWait(String... commands) throws Exception {
|
||||
if (commands.length > 0) {
|
||||
String command = String.join("\n", commands);
|
||||
execChannel = (ChannelExec) session.openChannel("exec");
|
||||
@@ -416,32 +415,12 @@ public class UserConnection {
|
||||
execChannel.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
public String CommandWithAnswer(char end, String... commands) throws Exception {
|
||||
String output = "";
|
||||
if (commands.length > 0) {
|
||||
String command = String.join("\n", commands);
|
||||
// UI.Print(DebugPrintLevel.Session, command);
|
||||
// UI.Print(DebugPrintLevel.Session, "Creating Exec Channel.");
|
||||
// System.out.println(Utils.Brackets(command));
|
||||
execChannel = (ChannelExec) session.openChannel("exec");
|
||||
execChannel.setErrStream(System.err);
|
||||
InputStreamReader reader = new InputStreamReader(execChannel.getInputStream());
|
||||
execChannel.setCommand(command);
|
||||
execChannel.connect();
|
||||
char[] chars = new char[1];
|
||||
while (reader.read(chars) >= 0) if (chars[0] == end) break;
|
||||
else output += chars[0];
|
||||
execChannel.disconnect();
|
||||
}
|
||||
// System.out.println(Utils.Brackets(output));
|
||||
return output;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
public void copy(RemoteFile src, RemoteFile dst) throws Exception {
|
||||
ShellCommand("cp " + Utils.DQuotes(src.full_name) + " " + Utils.DQuotes(dst.full_name));
|
||||
}
|
||||
*/
|
||||
public void performScriptNoWait(RemoteFile directory, String... commands) throws Exception {
|
||||
RemoteFile script_file = new RemoteFile(directory, Constants.script);
|
||||
if (Exists(script_file))
|
||||
sftpChannel.rm(script_file.full_name);
|
||||
//--
|
||||
writeToFile("cd " + Utils.DQuotes(directory.full_name) + "\n" + String.join("\n", commands), script_file);
|
||||
CommandNoWait(Utils.DQuotes(script_file.full_name));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user