hostname-bug/problem in anaconda network.py

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I think I found a bug in setting hostname in anaconda (RedHat 8 and 9).

Problem: hostname appears on 127.0.0.1 in /etc/hosts but hostname should
be on separate line. (It resolves fine during install).

Traced to anaconda in network.py in function lookupHostname(self)
It overwrites /etc/resolv.conf on line 197 regardless of previous content:

        f = open("/etc/resolv.conf", "w")
        f.write("nameserver %s\n" % self.primaryNS)
        f.close()

No search/domain-line is written here... why is this written at all? The
file is already correct (or?)

The gethostbyname after this will fail beacuse hostname is not FQDN and
lookup in DNS will fail. ( ip = socket.gethostbyname(self.hostname)  )

Why is /etc/resolv.conf rewritten here?

If I change the code on line 197 to:

  f = open("/etc/resolv.conf", "w")
  if self.domains != ['localdomain'] and self.domains:
    f.write("search %s\n" % (string.joinfields(self.domains, ' '),))

  for ns in self.nameservers():
    if ns:
     f.write("nameserver %s\n" % (ns,))
  f.close()

But this does not seem quite right,  does it?

  Regards

     Daniel




[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux