From 3676e5b33902570dd484a77b5ae1d92e79298468 Mon Sep 17 00:00:00 2001 From: lissav Date: Wed, 23 Feb 2011 14:49:16 +0000 Subject: [PATCH] fix defect 3187839 git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8911 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/InstUtils.pm | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/perl-xCAT/xCAT/InstUtils.pm b/perl-xCAT/xCAT/InstUtils.pm index e55a14741..a3cd11ace 100644 --- a/perl-xCAT/xCAT/InstUtils.pm +++ b/perl-xCAT/xCAT/InstUtils.pm @@ -122,11 +122,16 @@ sub myxCATname # make sure xcatd is running - & db is available # this routine is called during initial install of xCAT - my $rc = `lsxcatd -d`; - if ($rc == 0) { + my $cmd="lsxcatd -d > /dev/null 2>&1"; + my $outref = []; + @$outref = `$cmd`; + my $rc = $? >> 8; - if (xCAT::Utils->isMN()) - { + if ($rc == 0) + { + + if (xCAT::Utils->isMN()) + { # read the site table, master attrib my $hostname = xCAT::Utils->get_site_Master(); @@ -139,9 +144,9 @@ sub myxCATname $name = $hostname; } - } - elsif (xCAT::Utils->isServiceNode()) - { + } + elsif (xCAT::Utils->isServiceNode()) + { # the myxcatpost_ file should exist on all nodes! my $catcmd = "cat /xcatpost/myxcatpost_* | grep '^NODE='"; @@ -152,8 +157,8 @@ sub myxCATname { ($junk, $name) = split('=', $output); } - } - } + } + } if (!$name) { $name = hostname();