- // Launch remote command
- int status = system(command.c_str());
- if (status != 0)
- {
- // Error on resource - cannot launch commands
- INFOS("[LaunchContainer] Cannot launch commands on machine " << hostname);
- INFOS("[LaunchContainer] Command was " << command);
+ // Step 2: test resource
+ // Only if an application directory is set
+ if(hostname != Kernel_Utils::GetHostname() && _isAppliSalomeDefined)
+ {
+ // Preparing remote command
+ std::string command = "";
+ const ParserResourcesType resInfo(_resManager->GetResourceDefinition(resource_selected));
+ command = getCommandToRunRemoteProcess(resInfo.Protocol, resInfo.HostName, resInfo.UserName);
+ if (resInfo.AppliPath != "")
+ command += resInfo.AppliPath;
+ else
+ {
+ ASSERT(GetenvThreadSafe("APPLI"));
+ command += GetenvThreadSafeAsString("APPLI");
+ }
+ command += "/runRemote.sh ";
+ ASSERT(GetenvThreadSafe("NSHOST"));
+ command += GetenvThreadSafeAsString("NSHOST"); // hostname of CORBA name server
+ command += " ";
+ ASSERT(GetenvThreadSafe("NSPORT"));
+ command += GetenvThreadSafeAsString("NSPORT"); // port of CORBA name server
+ command += " \"ls /tmp >/dev/null 2>&1\"";
+
+ // Launch remote command
+ int status = SystemThreadSafe(command.c_str());
+ if (status != 0)
+ {
+ // Error on resource - cannot launch commands
+ INFOS("[LaunchContainer] Cannot launch commands on machine " << hostname);
+ INFOS("[LaunchContainer] Command was " << command);