Bug#236533: I am confused
Hello Thomas, Josh,
Ahh. I think I now see the root of the confusion.
With my setup DHCP does _not_ fail the first time it is tried, as seems to be
assumed in the code. It succeeds within the first 20% of the progress bar and
I get a perfectly usable lease for the first stage setup.
After that d-i notices I still don't have a hostname, so it offers 'debian' as
default (which I change), after which d-i happily continues the installation
_without_ DHCP being tried again.
(The domainname is set correctly to 'fjphome.nl' as offered by the DHCP
server.)
So, what I would like to see is 'Write "send host-name <host-name>"' added to
dhclient.conf either at (1) or at (2) as indicated in code below (using
hostname as host-name ;-)
In fact, I'm not sure that the 'else' branch to the first 'if' really adds
something: why would a DHCP-request with send host-name succeed if the first
try without one fails? However, it can't hurt either and I don't see anything
wrong with the code, but in my mind it's main function is just another retry.
I agree that host-name can be different from hostname. I don't think there is
a situation in which sending a host-name to the server would do any harm, so
I think (2) would be the correct location.
I've pasted an example of the lease I get at the bottom of this message.
The lease I get returned _after_ (manually) adding 'send host-name
"<host-name>"' is exactly the same (I think this indicates that the server
has accepted the proposed host-name), but having the client send it means the
DHCP-server is able to dynamically add the host-name in my DNS server (and so
enabling me to ping <host-name>.fjphome.nl from other boxes in the network).
Hope this helps.
Frans
On Thursday 24 June 2004 15:00, Thomas Hood wrote:
> I think that we should stop calling the argument of "send host-name"
> a "hostname". Instead let's call it a "host-name". The host-name
> can be different from the hostname. See #239591.
>
> Try DHCP
> If DHCP succeeded {
> If a hostname is returned {
> Ask the user for a hostname with the returned hostname
> as the default.
> } else {
> Ask the user for a hostname with "debian"
> as the default.
(1) <========
> }
> Write hostname to /etc/hostname and /etc/hosts
(2) <=======
> } else {
> Ask the user for a host-name
> Try DHCP with "send host-name <host-name>"
> If DHCP succeeded {
> Write "send host-name <host-name>" to dhclient.conf that
> gets used after reboot
> If a hostname is returned {
> Ask the user for a hostname with the returned hostname
> as the default.
> } else {
> Ask the user for a hostname with <host-name>
> as the default.
> }
> Write hostname to /etc/hostname and /etc/hosts
> }
> }
Example of lease during 1st stage setup
=======================================
lease {
interface "eth0";
fixed-address 10.19.66.32;
option subnet-mask 255.255.255.0;
option routers 10.19.66.1;
option domain-name-servers 10.19.66.2,10.19.66.1;
option domain-name "fjphome.nl";
option dhcp-lease-time 1800;
option dhcp-message-type 5;
option dhcp-server-identifier 10.19.66.2;
renew 4 2004/6/24 22:02:52;
rebind 4 2004/6/24 22:14:07;
expire 4 2004/6/24 22:17:52;
}
Reply to: