Bug 461933
Summary: | Anaconda sets hostname to localhost.localdomain | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Orion Poplawski <orion> |
Component: | NetworkManager | Assignee: | Dan Williams <dcbw> |
Status: | CLOSED NEXTRELEASE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | rawhide | CC: | dcbw, dchapman, wtogami |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2008-10-21 18:44:13 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Orion Poplawski
2008-09-11 14:37:39 UTC
This is fixed in the git repo and will be in the next build of anaconda. Still there with 11.4.1.40: 12:13:53 INFO : moving (1) to step preinstallconfig 12:13:53 DEBUG : isys.py:mount()- going to mount /selinux on /mnt/sysimage/selinux with options defaults 12:13:53 WARNING : no dev package, going to bind mount /dev 12:13:53 DEBUG : isys.py:mount()- going to mount /dev on /mnt/sysimage/dev with options defaults,bind 12:13:53 INFO : self.hostname = localhost.localdomain 12:13:53 INFO : moving (1) to step installpackages 15:08:49 INFO : Writing main configuration 15:08:53 INFO : self.hostname = localhost.localdomain 15:08:57 INFO : moving (1) to step firstboot Probably another side affect of moving to NM as NM doesn't set the hostname. Tested with latest rawhide and this appears to be working now. So long as you are doing a network-based install, the network connection will come up early and anaconda can figure out your hostname by either asking NetworkManager or trying a DNS lookup on your address. Doesn't work with 11.4.1.49: 08:34:29 DEBUG : isys.py:mount()- going to mount /dev on /mnt/sysimage/dev with options defaults,bind 08:34:29 INFO : self.hostname = localhost.localdomain 08:34:29 INFO : moving (1) to step installpackages 08:34:29 INFO : Preparing to install packages 09:12:40 WARNING : /usr/lib/anaconda/iw/progress_gui.py:55: GtkWarning: gtk_progress_set_percentage: assertion `percentage >= 0 && percentage <= 1.0' failed self.progress.set_fraction(pct) 09:13:06 INFO : moving (1) to step postinstallconfig 09:13:06 INFO : moving (1) to step writeconfig 09:13:06 INFO : Writing main configuration 09:13:10 INFO : self.hostname = localhost.localdomain 09:13:12 INFO : moving (1) to step firstboot NM (which happens all before the above - this is PXE boot/netowrk ks): <29>Oct 16 08:22:40 NetworkManager: <info> Setting system hostname to 'test' (from DHCP) <28>Oct 16 08:22:40 NetworkManager: <WARN> update_etc_hosts(): update_etc_hosts: couldn'tread /etc/hosts: (4) Failed to open file '/etc/hosts': No such file or directory <28>Oct 16 08:22:40 NetworkManager: <WARN> update_etc_hosts(): update_etc_hosts: couldn'tupdate /etc/hosts: (4) Failed to open file '/etc/hosts': No such file or directory <29>Oct 16 08:22:40 NetworkManager: <info> Setting system hostname to 'localhost.localdomain' (error updating /etc/hosts) This looks like a bug in update_etc_hosts() in src/NetworkManagerPolicy.c in NetworkManager. The call to g_file_set_contents() fails, which causes set_system_hostname() to revert back to localhost.localdomain. Not sure why g_file_set_contents() is failing. Reading update_etc_hosts() in NetworkManager, it looks like that function will create /etc/hosts if it doesn't exist, which is what we want. Any chance we could get the warning message that NM prints out when the g_set_file_contents() call fails? That'll tell us what's probably going wrong. The problem is that you are not clearing error from the previous g_file_get_contents call that fails. You probably want: --- NetworkManager-0.7.0/src/NetworkManagerPolicy.c.error 2008-10-11 12:05:54.000000000 -0600 +++ NetworkManager-0.7.0/src/NetworkManagerPolicy.c 2008-10-21 09:53:53.000000000 -0600 @@ -266,6 +266,7 @@ nm_warning ("%s: couldn't read " SYSCONFDIR "/hosts: (%d) %s", __func__, error ? error->code : 0, (error && error->message) ? error->message : "(unknown)"); + g_error_free (error); } else { lines = g_strsplit_set (contents, "\n\r", 0); g_free (contents); @@ -316,6 +317,7 @@ nm_warning ("%s: couldn't update " SYSCONFDIR "/hosts: (%d) %s", __func__, error ? error->code : 0, (error && error->message) ? error->message : "(unknown)"); + g_error_free (error); } else success = TRUE; Don't know if you also need to set error to NULL or if g_error_free does that for you. If run under --no-daemon you see the Glib error: NetworkManager: <info> Setting system hostname to 'test' (from DHCP) NetworkManager: <WARN> update_etc_hosts(): update_etc_hosts: couldn't read /etc/hosts: (4) Failed to open file '/etc/hosts': No such file or directory (NetworkManager:3539): GLib-CRITICAL **: g_file_set_contents: assertion `error == NULL || *error == NULL' failed NetworkManager: <WARN> update_etc_hosts(): update_etc_hosts: couldn't update /etc/hosts: (4) Failed to open file '/etc/hosts': No such file or directory NetworkManager: <info> Setting system hostname to 'localhost.localdomain' (error updating/etc/hosts) good catch, there probably isn't an /etc/hosts, thus the g_file_get_contents() call fails, and the fact that the error doesn't get reset causes the g_file_set_contents() to fail. Fixed upstream in svn r4201. *** Bug 468445 has been marked as a duplicate of this bug. *** NetworkManager-0.7.0-0.12.svn4326.fc9,NetworkManager-vpnc-0.7.0-0.11.svn4326.fc9,NetworkManager-openvpn-0.7.0-16.svn4326.fc9,NetworkManager-pptp-0.7.0-0.12.svn4326.fc9 has been submitted as an update for Fedora 9. http://admin.fedoraproject.org/updates/NetworkManager-0.7.0-0.12.svn4326.fc9,NetworkManager-vpnc-0.7.0-0.11.svn4326.fc9,NetworkManager-openvpn-0.7.0-16.svn4326.fc9,NetworkManager-pptp-0.7.0-0.12.svn4326.fc9 NetworkManager-0.7.0-0.12.svn4326.fc8,NetworkManager-vpnc-0.7.0-0.11.svn4326.fc8,NetworkManager-openvpn-0.7.0-16.svn4326.fc8,NetworkManager-pptp-0.7.0-0.12.svn4326.fc8 has been submitted as an update for Fedora 8. http://admin.fedoraproject.org/updates/NetworkManager-0.7.0-0.12.svn4326.fc8,NetworkManager-vpnc-0.7.0-0.11.svn4326.fc8,NetworkManager-openvpn-0.7.0-16.svn4326.fc8,NetworkManager-pptp-0.7.0-0.12.svn4326.fc8 NetworkManager-0.7.0-0.12.svn4326.fc9, NetworkManager-vpnc-0.7.0-0.11.svn4326.fc9, NetworkManager-openvpn-0.7.0-16.svn4326.fc9, NetworkManager-pptp-0.7.0-0.12.svn4326.fc9 has been pushed to the Fedora 9 stable repository. If problems still persist, please make note of it in this bug report. NetworkManager-0.7.0-0.12.svn4326.fc8, NetworkManager-vpnc-0.7.0-0.11.svn4326.fc8, NetworkManager-openvpn-0.7.0-16.svn4326.fc8, NetworkManager-pptp-0.7.0-0.12.svn4326.fc8 has been pushed to the Fedora 8 stable repository. If problems still persist, please make note of it in this bug report. |