Hi, Those 2 patches (against trunk) fix the creation of dhcpd.conf file. If the oscar nodes network is private (rfc1918), mkdhcpconf will not configure any DNS stuffs (domain-name and domain-name-servers). This will avoid clients to report an fqdn hostname while they're not in any DNS.
This network config fix will fix problems like SGE postinstal failing to resolve node hostname from a DNS thinking it is in the cluster head dns domain. Regarding the Network.pm patch, it includes a function to check if oscar network interface is on a private network. I think it was the appropriate place for this function to be inserted. If it is not, don't hesitate to move it elsewhere. The SQL query used to determine if the oscar network interface is on a private network (rfc1918) is the following. If it is incorrect, don't hesitate to fix: SELECT rfc1918 FROM Networks,Nics,Clusters WHERE Networks.n_id = Nics.network_id AND Nics.name = Clusters.headnode_interface AND Nics.node_id = 1; Regarding the mkdhcpconf patch, it uses the above function to check if oscar node nic is on a private netork and acts accordingly. Regards, Olivier. -- Olivier LAHAYE CEA Saclay DRT-LIST-DETECS-SSTM
Index: lib/OSCAR/Network.pm =================================================================== --- lib/OSCAR/Network.pm (révision 9147) +++ lib/OSCAR/Network.pm (copie de travail) @@ -376,6 +376,23 @@ return 0; } +################################################################################ +# This function test if headnode iface is on a private network. +# input: none +# Output: 1 if true +# 0 otherwize. +################################################################################ +sub is_head_nic_private () { + my $sql; + my @res; + my $sql = "SELECT rfc1918 FROM Networks,Nics,Clusters WHERE Networks.n_id = Nics.network_id AND Nics.name = Clusters.headnode_interface AND Nics.node_id = 1"; + if (OSCAR::Database_generic::do_select ($sql, \...@res, undef, undef) != 1) { + carp "ERROR: Impossible to execute SQL command ($sql)\n"; + return 0; + } + return $res[0]->{'rfc1918'}; +} + # This function populate ODA so that we store all data we need. ODA must be # previously initialized. #
Index: mkdhcpconf =================================================================== --- mkdhcpconf (révision 9147) +++ mkdhcpconf (copie de travail) @@ -3,6 +3,9 @@ eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' if 0; # not running under some shell +eval 'exec /usr/bin/perl -S $0 ${1+"$@"}' + if 0; # not running under some shell + # $Id$ # Copyright (c) 2001 International Business Machines @@ -32,6 +35,7 @@ use SIS::Adapter; use SIS::Image; use SIS::NewDB; +use OSCAR::Network; use SystemInstaller::Env; use SystemInstaller::Log qw(start_verbose stop_verbose verbose); use Net::Netmask; @@ -110,22 +114,33 @@ my @machinelist = SIS::NewDB::list_client(); my $adaplist = SIS::NewDB::list_adapter(undef); -# collect all domain names -# - first take those passed on the command line -# - add domains of all defined machines -my %all_domains; -for my $dom (split(" ",$HINFO{domain})) { - $dom =~ s/^\.//; - next if ($dom eq ""); - $all_domains{$dom} = 1; -} -foreach my $mach (@machinelist) { - if ($mach->{domainname}) { - my $k = $mach->{domainname}; - $all_domains{$k} = 1; +# On a private netwrok (rfc1918) it makes no sense to configure a +# DNS entry as nodes will have no entry to a DNS server. +# this would result with dns config on clients that will leads to +# dns resolving atttempts and timeouts or errors. + +if (OSCAR::Network::is_head_nic_private()) { + undef $HINFO{domain}; + undef $config->{nameservers}; + &verbose("Headnode iface is rfc1918; dns config ignored"); +} else { + # collect all domain names + # - first take those passed on the command line + # - add domains of all defined machines + my %all_domains; + for my $dom (split(" ",$HINFO{domain})) { + $dom =~ s/^\.//; + next if ($dom eq ""); + $all_domains{$dom} = 1; } + foreach my $mach (@machinelist) { + if ($mach->{domainname}) { + my $k = $mach->{domainname}; + $all_domains{$k} = 1; + } + } + $HINFO{domain} = join(" ",keys(%all_domains)); } -$HINFO{domain} = join(" ",keys(%all_domains)); &verbose("Printing file preamble"); &preamble(%HINFO); @@ -178,7 +193,9 @@ print OUTFILE "deny unknown-clients;\n"; print OUTFILE "option subnet-mask $HINFO{mask};\n"; print OUTFILE "option broadcast-address $HINFO{bcast};\n"; - print OUTFILE "option domain-name \"$HINFO{domain}\";\n"; + if ($HINFO{domain}) { + print OUTFILE "option domain-name \"$HINFO{domain}\";\n"; + } if ($config->gateway) { print OUTFILE "option routers ".$config->gateway.";\n"; }
------------------------------------------------------------------------------ Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev
_______________________________________________ Oscar-devel mailing list Oscar-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oscar-devel