Menu

#2048 hosts.pm doesn't create entries that match the node name

2.6.10
closed
General (881)
5
2013-01-25
2011-06-20
No

hosts.pm tries to out-guess the administrator and create entries that don't match the xCAT node name. Patch that corrects the behavior is attached.

Discussion

  • Garrick Staples

    Garrick Staples - 2011-06-20
     
  • Bruce

    Bruce - 2011-06-20

    Please give an example of the kind of node name that doesn't get put in /etc/hosts correctly.

     
  • Garrick Staples

    Garrick Staples - 2011-06-20

    fqdn nodes don't get put into /etc/hosts correctly.

     
  • Lissa Valletta

    Lissa Valletta - 2012-01-10

    Could we evaluate if this is a problem and the patch and close out this defect.

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-02-15

    HI Garric,

    Thanks for the patch, I read the patch carefully but still have some confusions, could you explain a little bit more? thanks.

    Here is the patch:

    --- hosts.pm_orig 2011-06-02 16:12:06.000000000 -0700
    +++ hosts.pm 2011-06-20 10:31:12.000000000 -0700
    @@ -76,6 +76,7 @@ sub build_line {
    my $othernames=shift;
    my @o_names=();
    my @n_names=();

    • my $orignode=$node;
      if (defined $othernames) {
      @o_names=split(/,| /, $othernames);
      }
      @@ -105,7 +106,14 @@ sub build_line {
      $othernames=join(' ', @o_names);
      if ($LONGNAME) { return "$ip $longname $node $othernames\n"; }
      elsif ($OTHERNAMESFIRST) { return "$ip $othernames $longname $node\n"; }
    • else { return "$ip $node $longname $othernames\n"; }
    • else {
    • if ($node eq $orignode) {
    • return "$ip $node $longname $othernames\n";
    • } else {
    • return "$ip $longname $node $othernames\n";
    • }
    • }
      +
      }

    In the patch, you changed the hosts order based on if ($node eq $orignode) i.e., if the node name passed in is long hostname, but I do not quite understand on why the hosts order matters, could you please give an example on why it matters? thank you.

     
  • Garrick Staples

    Garrick Staples - 2012-02-15

    I'm not really submitting that patch for inclusion, that was just my hack to make things work. The point is to have the nodename (the name in nodelist.tab) first in the list.

    The order matters to get matching forward and reverse lookup. If you have a fqdn as your node (fqdn in nodelist.tab) and the short name is listed first, then the xcatd can't identify the node when it phones home.

    If you have mixed fqdn and non-fqdn nodenames, xcatd gets horribly confused.

    Putting the actual nodename first in the list always gives you correct forward and reverse lookups and all node installs can complete successfully.

     
  • Guang Cheng Li

    Guang Cheng Li - 2012-02-15

    Thanks, I think I understand the situation now, you want to use either the shorthostname or the long hostname as the xCAT node name, or even a mixure. Using long hostname or ip address as the xCAT node name is not formally supported by xCAT for now, we will need a little bit more work to make it work. I added a wishlist item for this support at https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Wish_List_for_xCAT_2, xCAT team will go through the list when the next xCAT release starts.

     
  • Brian  Croswell

    Brian Croswell - 2013-01-25

    Cleanup old bugs

     
  • Brian  Croswell

    Brian Croswell - 2013-01-25
    • status: pending --> closed
    • milestone: --> 2.6.10
     
MongoDB Logo MongoDB