1) This can't be reproduced 100% of the time, but when it does happen, the results on the system are disastrous.
2) That /etc/hosts bares an uncanny similarity to the one that NetworkManager would normally generate if it encountered an empty /etc/hosts. So there looks to be two bugs at play.
a) There looks to be a bug with that in that no new lines are spit out by Network Manager
b) If Network Manager calls update_etc_hosts at the exact same time that oem-config was changing the hostname, you can run into this scenario. OEM-config shouldn't be changing the hostname at all in the first place though as there is no place in the UI to set it.
here's a snippet from src/NetworkManagerPolicy.c:
/* Hmm, /etc/hosts was empty for some reason */
if (!added) { g_string_append (new_contents, "# Do not remove the following line, or various programs"); g_string_append (new_contents, "# that require network functionality will fail."); g_string_append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost");
}
So two things worth mentioning:
1) This can't be reproduced 100% of the time, but when it does happen, the results on the system are disastrous.
2) That /etc/hosts bares an uncanny similarity to the one that NetworkManager would normally generate if it encountered an empty /etc/hosts. So there looks to be two bugs at play.
a) There looks to be a bug with that in that no new lines are spit out by Network Manager
b) If Network Manager calls update_etc_hosts at the exact same time that oem-config was changing the hostname, you can run into this scenario. OEM-config shouldn't be changing the hostname at all in the first place though as there is no place in the UI to set it.
here's a snippet from src/NetworkMana gerPolicy. c:
/* Hmm, /etc/hosts was empty for some reason */
g_string_ append (new_contents, "# Do not remove the following line, or various programs");
g_string_ append (new_contents, "# that require network functionality will fail.");
g_string_ append (new_contents, "127.0.0.1\t" FALLBACK_HOSTNAME "\tlocalhost");
if (!added) {
}
error = NULL; set_contents (SYSCONFDIR "/hosts", new_contents->str, -1, &error)) {
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);
success = TRUE;
if (!g_file_
if (error)
} else
return success;