Don't try connecting to remote node if preliminary node allocation has failed for any reason

ulab-next-nosound
Timothy Pearson 6 years ago
parent 7d0cd0c4b1
commit 0aa28343e6

@ -523,7 +523,7 @@ wait_for_remote_hostname(char* username)
/* wait up to 5 secs for hostname to appear */
i = 0;
const char * hostname = raptor_sm_get_hostname_for_username(username, false);
while (strcmp(hostname, "") == 0)
while ((strcmp(hostname, "") == 0) || (strcmp(hostname, "ERROR") == 0))
{
g_free(hostname);
hostname = raptor_sm_get_hostname_for_username(username, false);
@ -693,15 +693,21 @@ session_start_fork(int width, int height, int bpp, char *username,
else if (pampid == 0)
{
char* remote_server = wait_for_remote_hostname(username);
wait_for_remote_xserver(remote_server, display);
env_set_user(username, 0, display,
g_cfg->session_variables1,
g_cfg->session_variables2);
//if (x_server_running(display))
if (x_server_running_check_remote_ports(remote_server, display))
if ((strcmp(remote_server, "") == 0) || (strcmp(remote_server, "ERROR") == 0))
{
g_free(remote_server);
remote_server = NULL;
log_message(LOG_LEVEL_ERROR, "Unable to find available node for specified user / group. Check group mappings in database?\n");
}
else {
wait_for_remote_xserver(remote_server, display);
env_set_user(username, 0, display,
g_cfg->session_variables1,
g_cfg->session_variables2);
}
if (remote_server && x_server_running_check_remote_ports(remote_server, display)) {
g_free(remote_server);
// // RAPTOR session management
// raptor_sm_run_remote_desktop(username, display, "/opt/trinity/bin/starttde");
@ -800,6 +806,10 @@ session_start_fork(int width, int height, int bpp, char *username,
else
{
g_free(remote_server);
if (remote_server)
{
g_free(remote_server);
}
log_message(LOG_LEVEL_ERROR, "another Xserver might "
"already be active on display %d - see log", display);
}

Loading…
Cancel
Save