Skip to content

Commit d9c555b

Browse files
author
Ralph Castain
committed
Revert "Per request from Andy Rieb, add ability to pass PATH and LD_LIBRARY_PATH elements to ssh command"
This reverts commit 278324c. Revert "Add the ability to pass args to the rsh/ssh command line" This reverts commit 6f227f8.
1 parent 79b9c50 commit d9c555b

File tree

3 files changed

+22
-67
lines changed

3 files changed

+22
-67
lines changed

orte/mca/plm/rsh/plm_rsh.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
* reserved.
1414
* Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
1515
* Copyright (c) 2011 IBM Corporation. All rights reserved.
16-
* Copyright (c) 2015 Intel, Inc. All rights reserved.
1716
* $COPYRIGHT$
1817
*
1918
* Additional copyrights may follow
@@ -63,9 +62,6 @@ struct orte_plm_rsh_component_t {
6362
char *agent;
6463
bool assume_same_shell;
6564
bool pass_environ_mca_params;
66-
char *ssh_args;
67-
char *pass_path;
68-
char *pass_libpath;
6965
};
7066
typedef struct orte_plm_rsh_component_t orte_plm_rsh_component_t;
7167

orte/mca/plm/rsh/plm_rsh_component.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
* reserved.
1717
* Copyright (c) 2009-2015 Cisco Systems, Inc. All rights reserved.
1818
* Copyright (c) 2011 IBM Corporation. All rights reserved.
19-
* Copyright (c) 2015 Intel, Inc. All rights reserved.
2019
* $COPYRIGHT$
2120
*
2221
* Additional copyrights may follow
@@ -202,29 +201,6 @@ static int rsh_component_register(void)
202201
OPAL_INFO_LVL_9,
203202
MCA_BASE_VAR_SCOPE_READONLY,
204203
&mca_plm_rsh_component.pass_environ_mca_params);
205-
mca_plm_rsh_component.ssh_args = NULL;
206-
(void) mca_base_component_var_register (c, "args",
207-
"Arguments to add to rsh/ssh",
208-
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
209-
OPAL_INFO_LVL_9,
210-
MCA_BASE_VAR_SCOPE_READONLY,
211-
&mca_plm_rsh_component.ssh_args);
212-
213-
mca_plm_rsh_component.pass_path = NULL;
214-
(void) mca_base_component_var_register (c, "pass_path",
215-
"Prepend the specified path to the remote shell's path",
216-
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
217-
OPAL_INFO_LVL_9,
218-
MCA_BASE_VAR_SCOPE_READONLY,
219-
&mca_plm_rsh_component.pass_path);
220-
221-
mca_plm_rsh_component.pass_libpath = NULL;
222-
(void) mca_base_component_var_register (c, "pass_libpath",
223-
"Prepend the specified library path to the remote shell's LD_LIBRARY_PATH",
224-
MCA_BASE_VAR_TYPE_STRING, NULL, 0, 0,
225-
OPAL_INFO_LVL_9,
226-
MCA_BASE_VAR_SCOPE_READONLY,
227-
&mca_plm_rsh_component.pass_libpath);
228204

229205
return ORTE_SUCCESS;
230206
}

orte/mca/plm/rsh/plm_rsh_module.c

Lines changed: 22 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* reserved.
1515
* Copyright (c) 2008-2009 Sun Microsystems, Inc. All rights reserved.
1616
* Copyright (c) 2011 IBM Corporation. All rights reserved.
17-
* Copyright (c) 2014-2015 Intel Corporation. All rights reserved.
17+
* Copyright (c) 2014 Intel Corporation. All rights reserved.
1818
* Copyright (c) 2015 Research Organization for Information Science
1919
* and Technology (RIST). All rights reserved.
2020
* $COPYRIGHT$
@@ -339,8 +339,7 @@ static int setup_launch(int *argcptr, char ***argvptr,
339339
int rc;
340340
int i, j;
341341
bool found;
342-
char *lib_base, *bin_base;
343-
342+
344343
/* Figure out the basenames for the libdir and bindir. This
345344
requires some explanation:
346345
@@ -373,15 +372,6 @@ static int setup_launch(int *argcptr, char ***argvptr,
373372
*/
374373
argv = opal_argv_copy(rsh_agent_argv);
375374
argc = opal_argv_count(rsh_agent_argv);
376-
/* if any ssh args were provided, now is the time to add them */
377-
if (NULL != mca_plm_rsh_component.ssh_args) {
378-
char **ssh_argv;
379-
ssh_argv = opal_argv_split(mca_plm_rsh_component.ssh_args, ' ');
380-
for (i=0; NULL != ssh_argv[i]; i++) {
381-
opal_argv_append(&argc, &argv, ssh_argv[i]);
382-
}
383-
opal_argv_free(ssh_argv);
384-
}
385375
*node_name_index1 = argc;
386376
opal_argv_append(&argc, &argv, "<template>");
387377

@@ -441,23 +431,7 @@ static int setup_launch(int *argcptr, char ***argvptr,
441431
orted_cmd = opal_argv_join_range(orted_argv, orted_index, opal_argv_count(orted_argv), ' ');
442432
}
443433
opal_argv_free(orted_argv); /* done with this */
444-
445-
/* if the user specified a path to pass, set it up now */
446-
value = opal_basename(opal_install_dirs.bindir);
447-
if (NULL != mca_plm_rsh_component.pass_path) {
448-
asprintf(&bin_base, "%s:%s/%s", mca_plm_rsh_component.pass_path, prefix_dir, value);
449-
} else {
450-
asprintf(&bin_base, "%s/%s", prefix_dir, value);
451-
}
452434

453-
/* if the user specified a library path to pass, set it up now */
454-
value = opal_basename(opal_install_dirs.libdir);
455-
if (NULL != mca_plm_rsh_component.pass_path) {
456-
asprintf(&lib_base, "%s:%s/%s", mca_plm_rsh_component.pass_libpath, prefix_dir, value);
457-
} else {
458-
asprintf(&lib_base, "%s/%s", prefix_dir, value);
459-
}
460-
461435
/* we now need to assemble the actual cmd that will be executed - this depends
462436
* upon whether or not a prefix directory is being used
463437
*/
@@ -468,7 +442,9 @@ static int setup_launch(int *argcptr, char ***argvptr,
468442
*/
469443
char *opal_prefix = getenv("OPAL_PREFIX");
470444
char* full_orted_cmd = NULL;
445+
char *lib_base, *bin_base;
471446

447+
bin_base = opal_basename(opal_install_dirs.bindir);
472448

473449
if (NULL != orted_cmd) {
474450
if (0 == strcmp(orted_cmd, "orted")) {
@@ -481,6 +457,8 @@ static int setup_launch(int *argcptr, char ***argvptr,
481457
free(orted_cmd);
482458
}
483459

460+
lib_base = opal_basename(opal_install_dirs.libdir);
461+
484462
if (ORTE_PLM_RSH_SHELL_SH == remote_shell ||
485463
ORTE_PLM_RSH_SHELL_KSH == remote_shell ||
486464
ORTE_PLM_RSH_SHELL_ZSH == remote_shell ||
@@ -490,14 +468,16 @@ static int setup_launch(int *argcptr, char ***argvptr,
490468
* we have to insert the orted_prefix in the right place
491469
*/
492470
(void)asprintf (&final_cmd,
493-
"%s%s%s PATH=%s:$PATH ; export PATH ; "
494-
"LD_LIBRARY_PATH=%s:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
495-
"DYLD_LIBRARY_PATH=%s:$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
471+
"%s%s%s PATH=%s/%s:$PATH ; export PATH ; "
472+
"LD_LIBRARY_PATH=%s/%s:$LD_LIBRARY_PATH ; export LD_LIBRARY_PATH ; "
473+
"DYLD_LIBRARY_PATH=%s/%s:$DYLD_LIBRARY_PATH ; export DYLD_LIBRARY_PATH ; "
496474
"%s %s",
497475
(opal_prefix != NULL ? "OPAL_PREFIX=" : " "),
498476
(opal_prefix != NULL ? opal_prefix : " "),
499477
(opal_prefix != NULL ? " ; export OPAL_PREFIX;" : " "),
500-
bin_base, lib_base, lib_base,
478+
prefix_dir, bin_base,
479+
prefix_dir, lib_base,
480+
prefix_dir, lib_base,
501481
(orted_prefix != NULL ? orted_prefix : " "),
502482
(full_orted_cmd != NULL ? full_orted_cmd : " "));
503483
} else if (ORTE_PLM_RSH_SHELL_TCSH == remote_shell ||
@@ -515,25 +495,28 @@ static int setup_launch(int *argcptr, char ***argvptr,
515495
* we have to insert the orted_prefix in the right place
516496
*/
517497
(void)asprintf (&final_cmd,
518-
"%s%s%s set path = ( %s $path ) ; "
498+
"%s%s%s set path = ( %s/%s $path ) ; "
519499
"if ( $?LD_LIBRARY_PATH == 1 ) "
520500
"set OMPI_have_llp ; "
521501
"if ( $?LD_LIBRARY_PATH == 0 ) "
522-
"setenv LD_LIBRARY_PATH %s ; "
502+
"setenv LD_LIBRARY_PATH %s/%s ; "
523503
"if ( $?OMPI_have_llp == 1 ) "
524-
"setenv LD_LIBRARY_PATH %s:$LD_LIBRARY_PATH ; "
504+
"setenv LD_LIBRARY_PATH %s/%s:$LD_LIBRARY_PATH ; "
525505
"if ( $?DYLD_LIBRARY_PATH == 1 ) "
526506
"set OMPI_have_dllp ; "
527507
"if ( $?DYLD_LIBRARY_PATH == 0 ) "
528-
"setenv DYLD_LIBRARY_PATH %s ; "
508+
"setenv DYLD_LIBRARY_PATH %s/%s ; "
529509
"if ( $?OMPI_have_dllp == 1 ) "
530-
"setenv DYLD_LIBRARY_PATH %s:$DYLD_LIBRARY_PATH ; "
510+
"setenv DYLD_LIBRARY_PATH %s/%s:$DYLD_LIBRARY_PATH ; "
531511
"%s %s",
532512
(opal_prefix != NULL ? "setenv OPAL_PREFIX " : " "),
533513
(opal_prefix != NULL ? opal_prefix : " "),
534514
(opal_prefix != NULL ? " ;" : " "),
535-
bin_base, lib_base, lib_base,
536-
lib_base, lib_base,
515+
prefix_dir, bin_base,
516+
prefix_dir, lib_base,
517+
prefix_dir, lib_base,
518+
prefix_dir, lib_base,
519+
prefix_dir, lib_base,
537520
(orted_prefix != NULL ? orted_prefix : " "),
538521
(full_orted_cmd != NULL ? full_orted_cmd : " "));
539522
} else {

0 commit comments

Comments
 (0)