From a54c5cc27ae8e11a616d6bb4f2937b54f5edcf0f Mon Sep 17 00:00:00 2001 From: lissav Date: Thu, 11 Sep 2008 18:45:54 +0000 Subject: [PATCH] change remote shell default to use rsh on AIX, if ssh is not installed git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2144 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/lib/xcat/dsh/Context/XCAT.pm | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm index e86b48942..e84e4e1fb 100644 --- a/xCAT-server/lib/xcat/dsh/Context/XCAT.pm +++ b/xCAT-server/lib/xcat/dsh/Context/XCAT.pm @@ -289,7 +289,10 @@ sub resolve_node Using xCAT native commands, store the remote command settings for the remote shell and remote copy commands as defined in xCAT - site.tab file. + site table . + if no site table (rsh, rcp attribute) definition, then + on Linux use ssh + on AIX, check for ssh and use it is installed, otherwise use rsh Arguments: None @@ -315,8 +318,19 @@ sub resolve_node #------------------------------------------------------------------------------- sub get_xcat_remote_cmds { - $XCAT_RSH_CMD = "/usr/bin/ssh"; # default - $XCAT_RCP_CMD = "/usr/bin/scp"; #default + if (xCAT::Utils->isLinux()) { + $XCAT_RSH_CMD = "/usr/bin/ssh"; # use ssh + $XCAT_RCP_CMD = "/usr/bin/scp"; + } else { # AIX + if (-e "/usr/bin/ssh") { # ssh is installed + $XCAT_RSH_CMD = "/usr/bin/ssh"; # use ssh + $XCAT_RCP_CMD = "/usr/bin/scp"; + } else { + $XCAT_RSH_CMD = "/usr/bin/rsh"; # no ssh, use rsh + $XCAT_RCP_CMD = "/usr/bin/rcp"; + } + } + # override with site table settings, if they exist my @remote_shell = xCAT::Utils->get_site_attribute("rsh"); if ($remote_shell[0]) {