isShadowdInst = isValueEqualsTrue(idata, VAR_INSTALL_SHADOW);
isExecdInst = isValueEqualsTrue(idata, VAR_INSTALL_EXECD);
isJmxEnabled = isValueEqualsTrue(idata, VAR_SGE_JMX);
isBdbInst = isValueEqualsTrue(idata, VAR_INSTALL_BDB);
VariableSubstitutor vs = new VariableSubstitutor(idata.getVariables());
// Only once...
if (getNumOfExecution() == 0) {
// Localhost arch
Properties variables = idata.getVariables();
GetArchCommand archCmd = new GetArchCommand(Host.localHostName, Util.DEF_CONNECT_USER,
variables.getProperty(VAR_SHELL_NAME, ""), (Util.IS_MODE_WINDOWS && Host.localHostArch.startsWith("win")), variables.getProperty(VAR_SGE_ROOT, ""));
archCmd.execute();
if (archCmd.getExitValue() == 0 && archCmd.getOutput().size() > 0) {
Host.localHostArch = archCmd.getOutput().get(0).trim();
idata.setVariable(VAR_LOCALHOST_ARCH, Host.localHostArch);
Debug.trace("localhost.arch='" + idata.getVariable(VAR_LOCALHOST_ARCH) + "'");
}
// Check user
if (vs.substituteMultiple(idata.getVariable(VAR_CONNECT_USER), null).equals(vs.substituteMultiple(idata.getVariable(VAR_USER_NAME), null))) {
String sgeRoot = vs.substitute(idata.getVariable(VAR_SGE_ROOT), null);
String userName = vs.substitute(idata.getVariable(VAR_USER_NAME), null);
ExtendedFile sgeRootDir = new ExtendedFile(sgeRoot);
Debug.trace(sgeRootDir.getPermissions() + " " + sgeRootDir.getOwner() + " " + sgeRootDir.getGroup() + " " + sgeRoot);
if (!userName.equals("root")) {
if (userName.equals(sgeRootDir.getOwner())) {
Debug.trace("You are not installing as user 'root'! This will allow you to run Grid Engine only under your user id for testing a limited functionality of Grid Engine!");
if (!silentMode && JOptionPane.NO_OPTION == JOptionPane.showOptionDialog(parent, vs.substituteMultiple(idata.langpack.getString(WARNING_USER_NOT_ROOT), null),
idata.langpack.getString("installer.warning"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null,
new Object[]{idata.langpack.getString("installer.yes"), idata.langpack.getString("installer.no")}, idata.langpack.getString("installer.yes"))) {
parent.exit(true);
}
} else {
Debug.error("You are not installing as user 'root' or as the owner of the Grid Engine root directory. You don't have enough permission to perform installation. The installation terminates!");
if (silentMode) {
return false;
} else {
JOptionPane.showOptionDialog(parent, vs.substituteMultiple(idata.langpack.getString(ERROR_USER_INVALID), null),
idata.langpack.getString("installer.error"), JOptionPane.CANCEL_OPTION, JOptionPane.ERROR_MESSAGE, null,
new Object[]{idata.langpack.getString("button.exit.label")}, idata.langpack.getString("button.exit.label"));
parent.exit(true);
}
}
}
}
// Set SGE_JMX_PORT to SGE_QMASTER_PORT + 2
idata.setVariable(VAR_SGE_JMX_PORT, Integer.toString(Integer.valueOf(idata.getVariable(VAR_SGE_QMASTER_PORT)) + 2));
}
// Set value for 'cond.qmaster.on.localhost' condition
Host.IS_QMASTER_ON_LOCALHOST = Host.localHostName.equalsIgnoreCase(idata.getVariable(VAR_QMASTER_HOST)) ||
Host.localHostIP.equalsIgnoreCase(idata.getVariable(VAR_QMASTER_HOST));
// cfg.spooling.method
if (isBdbInst) {
idata.setVariable(VAR_SPOOLING_METHOD, vs.substituteMultiple(idata.getVariable(VAR_SPOOLING_METHOD_BERKELEYDBSERVER), null));
} else if (getNumOfExecution() == 0) {
idata.setVariable(VAR_SPOOLING_METHOD, vs.substituteMultiple(idata.getVariable(VAR_SPOOLING_METHOD_BERKELEYDB), null));
}
// Detect Jvm Library if on qmaster host
if (isJmxEnabled && (isQmasterInst || isShadowdInst)) {
String sgeRoot = idata.getVariable(VAR_SGE_ROOT);