diff --git a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm index 0b9fd7455..58a02e341 100644 --- a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm +++ b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm @@ -6,6 +6,7 @@ use Socket; use xCAT::Utils; use xCAT::MsgUtils; use base xCAT::DSHContext; + # Define remote shell globals from xCAT our $XCAT_RSH_CMD; @@ -287,8 +288,10 @@ sub resolve_node get_xcat_remote_cmds Using xCAT native commands, store the remote command settings for - the remote shell and remote copy commands as defined in xCAT - site.tab file. + the remote shell and remote copy commands determined from the + site.tab file useSSHonAIX attribute. If the attribute is set to yes or 1 + then we will setup and use ssh on AIX, otherwise we use rsh. On Linux, + we always setup and use ssh. Arguments: None @@ -314,17 +317,22 @@ sub resolve_node #------------------------------------------------------------------------------- sub get_xcat_remote_cmds { - $XCAT_RSH_CMD = "/usr/bin/ssh"; # default - $XCAT_RCP_CMD = "/usr/bin/scp"; #default - my @remote_shell = xCAT::Utils->get_site_attribute("rsh"); - if ($remote_shell[0]) + if (xCAT::Utils::isLinux) { - $XCAT_RSH_CMD = $remote_shell[0]; + $XCAT_RSH_CMD = "/usr/bin/ssh"; # default + $XCAT_RCP_CMD = "/usr/bin/scp"; #default } - my @remote_copy = xCAT::Utils->get_site_attribute("rcp"); - if ($remote_copy[0]) - { - $XCAT_RCP_CMD = $remote_copy[0]; + else + { # AIX + $XCAT_RSH_CMD = "/bin/rsh"; # default + $XCAT_RCP_CMD = "/bin/rcp"; #default + my @usesshonaix = xCAT::Utils->get_site_attribute("useSSHonAIX"); + $usesshonaix[0] =~ tr/a-z/A-Z/; # convert to upper + if (($usesshonaix[0] eq "1") || ($usesshonaix[0] eq "YES")) + { # use ssh/scp + $XCAT_RSH_CMD = "/bin/ssh"; # default + $XCAT_RCP_CMD = "/bin/scp"; #default + } } }