Fix xdsh call and replication logic.

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3292 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
nott 2009-05-05 14:12:00 +00:00
parent 3857fcad88
commit 2fe7e4a272

View File

@ -800,7 +800,8 @@ if (0) {
$error++;
}
# move inetd start to servicenode
}
# restart inetd
if ($::VERBOSE) {
my $rsp;
@ -824,8 +825,6 @@ if (0) {
$error++;
}
} # end if 0
if ($error) {
my $rsp;
push @{$rsp->{data}}, "$Sname: One or more errors occurred when attempting to initialize AIX NIM nodes.\n";
@ -1988,6 +1987,7 @@ sub mk_resolv_conf
my $fileloc;
my $loc;
if ($::opt_l) {
$loc = "$::opt_l/resolv_conf/$resolv_conf_name";
} else {
$loc = "/install/nim/resolv_conf/$resolv_conf_name";
@ -3895,6 +3895,12 @@ sub prenimnodeset
}
}
# Checks the various credential files on the Management Node to
# make sure the permission are correct for using and transferring
# to the nodes and service nodes.
# Also removes /install/postscripts/etc/xcat/cfgloc if found
my $result= xCAT::Utils->checkCredFiles($callback);
#####################################################
#
# Copy files/dirs to remote service nodes so they can be
@ -4318,7 +4324,8 @@ sub doSNcopy
# get a list of the resources that are defined on the SN
my $cmd = qq~xdsh $snkey "/usr/sbin/lsnim -c resources | /usr/bin/cut -f1 -d' '"~;
@nimresources = xCAT::Utils->runcmd("$cmd", -1);
# ndebug
my @resources = xCAT::Utils->runcmd("$cmd", -1);
if ($::RUNCMD_RC != 0)
{
my $rsp;
@ -4326,6 +4333,12 @@ sub doSNcopy
xCAT::MsgUtils->message("E", $rsp, $callback);
return 1;
}
foreach my $r (@resources) {
my ($node, $nimres) = split(': ', $r);
chomp $nimres;
push(@nimresources, $nimres);
}
# for each image
foreach my $image (@{$SNosi{$snkey}}) {
@ -4347,7 +4360,6 @@ sub doSNcopy
# if the resources are not defined on the SN
###### TODO - need to handle a force option !!!!
if (!grep(/^$res$/, @nimresources))
#if (1)
{
# copy appropriate files to the SN
@ -4365,8 +4377,7 @@ sub doSNcopy
my $rsp;
push @{$rsp->{data}}, "Copying NIM resources to the xCAT $snkey service node. This could take a while.";
xCAT::MsgUtils->message("I", $rsp, $callback);
}
}
if (&copyres($callback, $snkey, $restype, $resloc, $res, $nimprime) ) {
# error
@ -4888,9 +4899,6 @@ ll~;
$error++;
}
# do this in servicenode script
if (0) {
# restart inetd
if ($::VERBOSE) {
my $rsp;
@ -4913,8 +4921,6 @@ if (0) {
xCAT::MsgUtils->message("E", $rsp, $callback);
$error++;
}
}
#
# process any errors
@ -5294,8 +5300,14 @@ sub make_SN_resource
# if a valid NIM type and a value is set
if (($imghash{$image}{$restype}) && (grep(/^$restype$/, @nimrestypes))) {
# Note: - for now keep it simple - if the resource exists
# then don't try to recreate it
# see if it already exists on this SN
if (grep(/^$imghash{$image}{$restype}$/, @nimresources)) {
# if (grep(/^$imghash{$image}{$restype}$/, @nimresources))
#ndebug
if (0)
{
# is it allocated?
my $cmd = "/usr/sbin/lsnim -l $imghash{$image}{$restype} 2>/dev/null";
my @result = xCAT::Utils->runcmd("$cmd", -1);
@ -5338,6 +5350,16 @@ sub make_SN_resource
}
}
# see if it already exists on this SN
if (grep(/^$imghash{$image}{$restype}$/, @nimresources)) {
my $rsp;
push @{$rsp->{data}}, "Using existing resource called \'$imghash{$image}{$restype}\'.\n";
xCAT::MsgUtils->message("I", $rsp, $callback);
next;
}
# if root, tmp, home, shared_home, dump, paging then
# these dont require copying anything from the nim primary
my @dir_res=("root", "tmp", "home", "shared_home", "dump", "paging");
@ -5563,18 +5585,6 @@ sub rmdsklsnode
my $Sname = &myxCATname();
chomp $Sname;
if (0) {
if (defined(@{$::args})) {
@ARGV = @{$::args};
} else {
&rmdsklsnode_usage($callback);
return 0;
}
}
# parse the options
if(!GetOptions(
'f|force' => \$::FORCE,
@ -5587,22 +5597,6 @@ if (0) {
return 1;
}
if (0) {
my $a = shift @ARGV;
# need a node range
unless ($a) {
# error - must have list of nodes
&rmdsklsnode_usage($callback);
return 1;
}
#my @nodelist = &noderange($a, 0);
}
if (!defined(@nodelist) ) {
# error - must have list of nodes
&rmdsklsnode_usage($callback);