Description of Problem: see bug 59563 for the full original story. swapped network card from 7.3 to Limbo, boot it up, no hostname is set. default install with autopartitioning on a 4G disk. Component dhclient is not in bugzilla. Please add it.
I don't have a separate DHCP network to test on, and the server here doesn't send hostnames so mine definitely wouldn't be set. You probably want to send a patch to /sbin/ dhclient-script - shouldn't be hard to modify to demonstrate your desired behaviour.
You can use VMWARE ....
I won't use vmware... I do remember fixing some hostname/domainname type problems in dhclient-script, so it's worth trying the latest package from rawhide. I'm a bit confused looking at the bug referred to since it is about misset NIS/DNS domain AFAICT.
The original bug started as misset NIS/DNS domain because I used -H option as described in manual page. However it turned out that man page is wrong and -H option is not needed to acomplish the task (of setting up hostname from DHCP server). Limbo2 still does not set hostname. Please let me know the version of dhclient I should try.
Try ftp://people.redhat.com/sopwith/3.0pl1-5/ (will also be in rawhide).
Tested -5. Hostname has been set. Attempted to verify nisdomainname - it isn't set. Red Hat 7.3 based DHCP server has line option nis-domain "mynisdomain" in its /etc/dhcpd.conf Used to work in Red Hat 7.3 with Red Hat 7.2 based DHCP server.
Re-assigning this, as it still appears that we have some problems.
And they are?
Please see above. NIS domain is ignored. Works perfectly in Red Hat 7.3. I looked at dhclient-script and found no attempts to set NIS domain.
You don't find it at line 131 of dhclient-3.0pl1-7?
As my note says I only tested -5. Does the current latest beta have -7? If yes, I'll get it soon and verify.
Just finished fresh install of latest beta. I do see NIS in line 131 but enviroment variable is empty. I added set > /tmp/dhcp.dbg at the top and here is the output after ifdown eth0; ifup eth0 interface=eth0 new_broadcast_address=XXX.XXX.XXX.XXX new_dhcp_lease_time=3600 new_dhcp_message_type=5 new_dhcp_server_identifier=XXX.XXX.XXX.XXX new_domain_name=MYDOMAINNAME.COM new_domain_name_servers='XXX.XXX.XXX.XXX XXX.XXX.XXX.XXX' new_expiry=1030070685 new_host_name=MYHOSTNAME new_ip_address=XXX.XXX.XXX.XXX new_network_number=XXX.XXX.XXX.XXX new_routers=XXX.XXX.XXX.XXX new_subnet_mask=XXX.XXX.XXX.XXX pid=18346 reason=REBOOT I do not see NIS domain here. Server is 7.3 based, running dhcp-2.0pl5-8.
Does the nis-domain option show in /var/lib/dhcp/dhclient-eth0.leases?
No, it does not show. I figured it out. According to man dhclient.conf: "By default, the DHCP server requests the subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers and host-name options." Firstly it is clearly said that nis-domain is NOT requested by default (there seems to be a typo here since sentence above should read "DHCP client" and not "DHCP server"). Since /etc/dhclient-eth0.conf (this what current dhclient is looking for) does not exists I created a file with a single line request subnet-mask, broadcast-address, time-offset, routers, domain-name, domain-name-servers, host-name, nis-domain and NIS domain was perfectly set as expected. Now what about nis-server? Seems like it has to be explicitly requested as well and then parsed by dhclient-script... The final solution (create a config file, recompile defaults and change man page, etc) is up to you. And one more problem. Since /etc/dhclient-${DEVICE}.conf does not exist the test (/sbin/ifup) if [ -w /etc/dhclient-${DEVICE}.conf ] ; then will always return false and feature like "send host name" will never work.
initscripts-6.90-1 has something for the [ -w ... ] test. I'll change default_requested_options, thanks for looking into it.
FWIW I am going to change dhclient-script to not override the hostname setting in /etc/ sysconfig/network (#72622) - once release 8 shows up in rawhide, please try it and make sure the setup still works (as well as fixes the NIS issues).
According to my tests [ -w $file ] returns false if $file does not exists. Confirmed from korn shell manual: File conditions: ..... -w file file exists and is writable. I just looked at latest awailable (initscripts-6.91-1.i386.rpm) and -w as written in /sbin/ifup will not work if blank /etc/dhclient-${DEVICE}.conf is not created before /sbin/ifup runs.
6.90 definitely has a block following that handles the case where the file doesn't exist.
Ok, I was not looking far enough. I see the extra block now. Thank you.
Eugene, looks like -9 is available from Rawhide, would you mind taking a crack at that and seeing if it still suites your needs?
I just did this early morning but I forgot to erase my /etc/dhclient-${DEVICE}.conf before the test. I'll have to it again later. However NIS related code in /sbin/dhclient-script looks very good except that it unconditionally erases /etc/yp.conf if DHCP server provides NIS configuration. I would like you consider a switch in case users want their /etc/yp.conf preserved. Not sure how important it might be but for consistency with already existing options for preserving hostname and /etc/resolv.conf. I also noticed that /etc/resolv.conf has comment "created by dhclient-script" and /etc/yp.conf does not.
Removed /etc/dhclient-${DEVICE}.conf. domain name has been set properly. However my DHCP server does not supply NIS server name so I did not test that functionality. Broadcast works.
I am going to close this bug as fixed. If parts are not fixed please enter new bug reports. Dan