policy: don't update hostname on exit

It's a leftover from when /etc/hosts got fixed up, and since that
isn't being done anymore, there's no reason to touch the hostname
on exit.  It will already have been updated in response to device
deactivation (if the hostname was DHCP-provided for example) so
it shouldn't need to be touched on exit.

This also removes a potential crash on shutdown when systemd or
another startup manager kills D-Bus before NetworkManager, which
made the dispatcher code angry (which got executed on hostname
change).
This commit is contained in:
Dan Williams 2011-01-02 10:24:23 -06:00
parent 2bee736df1
commit 81cb867e9f

View file

@ -1222,15 +1222,6 @@ nm_policy_destroy (NMPolicy *policy)
}
g_slist_free (policy->dev_signal_ids);
/* Rewrite /etc/hosts on exit to ensure we don't leave stale IP addresses
* lying around. FIXME: this will take out a valid IP address of an
* ethernet device we're leaving active (ie, a connection we can "assume"
* when NM starts again).
*/
policy->default_device4 = NULL;
policy->default_device6 = NULL;
update_system_hostname (policy, NULL, NULL);
g_free (policy->orig_hostname);
g_free (policy->cur_hostname);