Bug#651053: [Pkg-utopia-maintainers] Bug#651053: Don't prefer random DHCP hostname over system hostname
At Thu, 05 Jan 2012 19:35:17 +0100, Michael Biebl wrote: On 05.01.2012 19:22, Jeroen Dekkers wrote: At Thu, 05 Jan 2012 14:42:33 +0100, Michael Biebl wrote: Could you please attach your /etc/NetworkManager/nm-system-settings.conf If you have the ifupdown plugin enabled (which is the default), then the hostname configured in /etc/hostname should take precedence over the DHCP provided hostname. My nm-system-settings.conf is: [main] no-auto-default=ETH0MACADDR, My NetworkManager.conf is: [main] plugins=ifupdown,keyfile [ifupdown] managed=false Ok, this is your problem then. You have both, the old and deprecated nm-system-settings.conf file and the new NetworkManager.conf. As the old file takes precedence, and your nm-system-settings.conf does not contain plugins=ifupdown,keyfile, this might explain your problem. Please migrate any settings you have in nm-system-settings.conf to NetworkManager.conf, and delete that file. I can confirm this was the problem, after deleting the old file my hostname isn't changed anymore. I'm not sure how you ended up having both config files. The Debian package at least tries to migrate the settings in it postinst. It's possible that I downgraded network-manager in the past and that might explain having both configuration files. Kind regards, Jeroen -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#651053: Don't prefer random DHCP hostname over system hostname
Hi, Could you please attach your /etc/NetworkManager/nm-system-settings.conf If you have the ifupdown plugin enabled (which is the default), then the hostname configured in /etc/hostname should take precedence over the DHCP provided hostname. -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#651053: Don't prefer random DHCP hostname over system hostname
At Thu, 05 Jan 2012 14:42:33 +0100, Michael Biebl wrote: Could you please attach your /etc/NetworkManager/nm-system-settings.conf If you have the ifupdown plugin enabled (which is the default), then the hostname configured in /etc/hostname should take precedence over the DHCP provided hostname. My nm-system-settings.conf is: [main] no-auto-default=ETH0MACADDR, My NetworkManager.conf is: [main] plugins=ifupdown,keyfile [ifupdown] managed=false -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#651053: [Pkg-utopia-maintainers] Bug#651053: Don't prefer random DHCP hostname over system hostname
On 05.01.2012 19:22, Jeroen Dekkers wrote: At Thu, 05 Jan 2012 14:42:33 +0100, Michael Biebl wrote: Could you please attach your /etc/NetworkManager/nm-system-settings.conf If you have the ifupdown plugin enabled (which is the default), then the hostname configured in /etc/hostname should take precedence over the DHCP provided hostname. My nm-system-settings.conf is: [main] no-auto-default=ETH0MACADDR, My NetworkManager.conf is: [main] plugins=ifupdown,keyfile [ifupdown] managed=false Ok, this is your problem then. You have both, the old and deprecated nm-system-settings.conf file and the new NetworkManager.conf. As the old file takes precedence, and your nm-system-settings.conf does not contain plugins=ifupdown,keyfile, this might explain your problem. Please migrate any settings you have in nm-system-settings.conf to NetworkManager.conf, and delete that file. Then restart NM. I'm not sure how you ended up having both config files. The Debian package at least tries to migrate the settings in it postinst. Michael -- Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth? signature.asc Description: OpenPGP digital signature
Bug#651053: Don't prefer random DHCP hostname over system hostname
Package: network-manager Version: 0.9.2.0-1 Severity: important Tags: patch NetworkManager keeps changing my hostname when I connect to a wireless network. I'm a bit puzzled why NetworkManager gives a higher priority to the name that a dhcp server on a random wireless network returns than the hostname configured by the user in /etc/hostname. In my opinion NetworkManager shouldn't overrule configuration done by the user and in Debian the hostname is already set by /etc/init.d/hostname.sh. It causes a lot of trouble, from annoying change of your shell prompts to errors because your hostname isn't resolvable. The attached patch changes the order of preference, so that an already set hostname takes precedence over a hostname from DHCP. -- System Information: Debian Release: wheezy/sid APT prefers testing APT policy: (990, 'testing'), (500, 'unstable'), (150, 'experimental') Architecture: amd64 (x86_64) Kernel: Linux 3.1.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages network-manager depends on: ii adduser3.113 ii dbus 1.4.16-1 ii isc-dhcp-client4.1.1-P1-17 ii libc6 2.13-21 ii libdbus-1-31.4.16-1 ii libdbus-glib-1-2 0.98-1 ii libgcrypt111.5.0-3 ii libglib2.0-0 2.30.2-4 ii libgnutls262.12.14-3 ii libgudev-1.0-0 175-2 ii libnl1 1.1-7 ii libnm-glib40.9.2.0-1 ii libnm-util20.9.2.0-1 ii libpolkit-gobject-1-0 0.102-2 ii libuuid1 2.19.1-5 ii lsb-base 3.2-28 ii udev 175-2 ii wpasupplicant 0.7.3-5 Versions of packages network-manager recommends: ii dnsmasq-base 2.59-2 ii iptables 1.4.12-1 ii modemmanager 0.5-1 ii policykit-1 0.102-2 ii ppp 2.4.5-5 Versions of packages network-manager suggests: ii avahi-autoipd 0.6.30-5 -- Configuration Files: /etc/NetworkManager/nm-system-settings.conf changed [not included] (Only contents is the MAC address of the wired interface) -- no debconf information --- a/src/nm-policy.c +++ b/src/nm-policy.c @@ -307,8 +307,8 @@ /* Hostname precedence order: * * 1) a configured hostname (from settings) - * 2) automatic hostname from the default device's config (DHCP, VPN, etc) - * 3) the original hostname when NM started + * 2) the original hostname when NM started + * 3) automatic hostname from the default device's config (DHCP, VPN, etc) * 4) reverse-DNS of the best device's IPv4 address * */ @@ -321,6 +321,13 @@ return; } + /* Try using the hostname from when NM started up. + */ + if (policy-orig_hostname) { + _set_hostname (policy, policy-orig_hostname, from system startup); + return; + } + /* Try automatically determined hostname from the best device's IP config */ if (!best4) best4 = get_best_ip4_device (policy-manager, best_req4); @@ -375,14 +382,6 @@ } } - /* If no automatically-configured hostname, try using the hostname from - * when NM started up. - */ - if (policy-orig_hostname) { - _set_hostname (policy, policy-orig_hostname, from system startup); - return; - } - /* No configured hostname, no automatically determined hostname, and no * bootup hostname. Start reverse DNS of the current IPv4 or IPv6 address. */