do not set a forwarders with the ip address from resolv.conf, if it is the MN
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10101 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
888e85b597
commit
500746cb7e
@ -861,10 +861,23 @@ sub initDB
|
||||
$master = "NORESOLUTION";
|
||||
}
|
||||
# get forwarders which are the nameserver entries in /etc/resolv.conf
|
||||
# don't use if the address is this machine (Management Node)
|
||||
my $forwarders;
|
||||
my @names =
|
||||
# find out the names for the Management Node
|
||||
my @MNnodeinfo = xCAT::Utils->determinehostname;
|
||||
my $MNnodename = pop @MNnodeinfo; # hostname
|
||||
my @MNnodeipaddr = @MNnodeinfo; # ipaddresses
|
||||
|
||||
my @names;
|
||||
my @tmpnames =
|
||||
xCAT::Utils->runcmd(
|
||||
"/bin/grep ^[^#]*nameserver /etc/resolv.conf | awk '{print \$2}'", -1);
|
||||
foreach my $ip (@tmpnames) {
|
||||
if (!grep(/$ip/, @MNnodeipaddr))
|
||||
{ # if not the MN
|
||||
push @names,$ip; # add it as a forwarder
|
||||
}
|
||||
}
|
||||
if (@names)
|
||||
{
|
||||
$forwarders = join(',', @names);
|
||||
|
Loading…
Reference in New Issue
Block a user