Activity log for bug #537978

Date Who What changed Old value New value Message
2010-03-12 10:20:46 Valentijn Sessink bug added bug
2010-03-12 10:25:33 Valentijn Sessink description Until recently (up to and including Karmic), there was a "set_hostname()" function in /sbin/dhclient-script, that said: set_hostname() { local current_hostname=$(hostname) if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then hostname "$new_host_name" fi } Up to 9.04, this would work when there was no /etc/hostname. With 9.10 (Karmic), this changed: a missing /etc/hostname sets the hostname to "localhost" and the dhclient-script will no longer set the hostname: this bug is reported as bug #482313 and #523188 - see #482313 for the fix we have been using for years. Now with Lucid, the whole thing goes wrong, as the set_hostname() function is missing. There's only: BOUND|RENEW|REBIND|REBOOT) if [ -n "$old_host_name" -a -n "$host_name" -a \ "$host_name" != "$old_host_name" ]; then hostname "$new_host_name" fi This is plain wrong for two reasons: 1) as far as I can see, the $host_name variable does not exist at all; there's only an "old_host_name" and a "new_host_name", but "host_name" does not exist - which means the test will never be true. 2) if the test would be true at all, it would still only change the hostname if there is a change in the *dhcp-server supplied hostname*, i.e. if the hostname used to be "foo" and suddenly, the dhcp-server sends a hostname "bar", then the hostname will change. This is also against the dhclient documentation, see "man dhcp-options": option host-name string; This option specifies the name of the client. The name may or may not be qualified with the local domain name (it is preferable to use the domain-name option to specify the domain name). See RFC 1035 for character set restrictions. This option is only honored by dhclient-script(8) if the hostname for the client machine is not set. This is no longer true: under Lucid, the hostname will not be set at all, no matter what you try to do. Until recently (up to and including Karmic), there was a "set_hostname()" function in /sbin/dhclient-script, that said: set_hostname() {     local current_hostname=$(hostname)     if [ -z "$current_hostname" -o "$current_hostname" = "(none)" ]; then         hostname "$new_host_name"     fi } Up to 9.04, this would work when there was no /etc/hostname. With 9.10 (Karmic), this changed: a missing /etc/hostname sets the hostname to "localhost" and the dhclient-script will no longer set the hostname: this bug is reported as bug #482313 and bug #523188 - see bug #482313 for the fix we have been using for years. Now with Lucid, the whole thing goes wrong, as the set_hostname() function is missing. There's only:     BOUND|RENEW|REBIND|REBOOT)         if [ -n "$old_host_name" -a -n "$host_name" -a \              "$host_name" != "$old_host_name" ]; then             hostname "$new_host_name"         fi This is plain wrong for two reasons: 1) as far as I can see, the $host_name variable does not exist at all; there's only an "old_host_name" and a "new_host_name", but "host_name" does not exist - which means the test will never be true. 2) if the test would be true at all, it would still only change the hostname if there is a change in the *dhcp-server supplied hostname*, i.e. if the hostname used to be "foo" and suddenly, the dhcp-server sends a hostname "bar", then the hostname will change. This is also against the dhclient documentation, see "man dhcp-options": option host-name string;           This option specifies the name of the client. The name may or may           not be qualified with the local domain name (it is preferable to use           the domain-name option to specify the domain name). See RFC 1035           for character set restrictions. This option is only honored by           dhclient-script(8) if the hostname for the client machine is not           set. This is no longer true: under Lucid, the hostname will not be set at all, no matter what you try to do.
2010-03-15 12:42:10 Chuck Short dhcp3 (Ubuntu): importance Undecided Medium
2010-03-15 12:42:10 Chuck Short dhcp3 (Ubuntu): status New Confirmed
2010-03-22 14:50:24 Thierry Carrez bug watch added http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=508804
2010-03-22 14:50:50 Thierry Carrez dhcp3 (Ubuntu): status Confirmed Triaged
2010-03-22 14:51:07 Thierry Carrez nominated for series Ubuntu Lucid
2010-03-22 14:51:07 Thierry Carrez bug task added dhcp3 (Ubuntu Lucid)
2010-04-01 13:37:30 Thierry Carrez dhcp3 (Ubuntu Lucid): status Triaged In Progress
2010-04-01 13:37:30 Thierry Carrez dhcp3 (Ubuntu Lucid): assignee Thierry Carrez (ttx)
2010-04-01 16:41:39 Launchpad Janitor dhcp3 (Ubuntu Lucid): status In Progress Fix Released
2010-04-01 17:13:23 Launchpad Janitor branch linked lp:ubuntu/dhcp3