fix for bug 3421484: redirect ps to handle basecust perminent

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10738 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2011-10-11 08:37:07 +00:00
parent 359ed0f565
commit 02e9cb3760

View File

@ -15,10 +15,13 @@ if (!$ENV{'NFSSERVER'})
}
my $nfsserver = $ENV{'NFSSERVER'};
my @ps = ();
my @nfsserverps = ();
my $cmd = "lsps -t nfs -c";
&runcmd($cmd);
# Remove any inactive paging space from external nfs server first
foreach my $line (@::outref)
{
chomp($line);
@ -28,19 +31,44 @@ foreach my $line (@::outref)
}
my ($psname, $pshost, $psfile, $pssize, $psused, $psactive, $psauto, $pstype, $pschksum) = split(/:/, $line);
if ($pshost eq $nfsserver)
{
if ($psactive eq 'n')
{
# Inactive paging space, remove it
$cmd = "rmps $psname";
&runcmd($cmd);
}
else
{
push @nfsserverps, $psfile
}
}
else
{
push @ps, $line;
}
}
foreach my $psline (@ps)
{
my ($psname, $pshost, $psfile, $pssize, $psused, $psactive, $psauto, $pstype, $pschksum) = split(/:/, $psline);
if ($pshost eq $nfsserver)
{
next;
}
my $cmd = "mkps -a -n -t nfs $nfsserver $psfile";
&runcmd($cmd);
if (!grep(/^$psfile$/, @nfsserverps))
{
my $cmd = "mkps -a -n -t nfs $nfsserver $psfile";
&runcmd($cmd);
}
$cmd = "swapoff /dev/$psname";
&runcmd($cmd);
$cmd = "rmps $psname";
&runcmd($cmd);
}
sub runcmd
{
my ($cmd) = @_;