Bug 68650 - host name and NIS domain is not been set like in 7.3
Summary: host name and NIS domain is not been set like in 7.3
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dhcp
Version: 8.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 67218 79579
TreeView+ depends on / blocked
 
Reported: 2002-07-12 02:35 UTC by Eugene Kanter
Modified: 2008-05-01 15:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-01-24 21:40:22 UTC
Embargoed:


Attachments (Terms of Use)

Description Eugene Kanter 2002-07-12 02:35:23 UTC
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.

Comment 1 Elliot Lee 2002-07-12 22:06:25 UTC
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.


Comment 2 Eugene Kanter 2002-07-13 15:44:44 UTC
You can use VMWARE ....

Comment 3 Elliot Lee 2002-08-08 15:12:31 UTC
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.

Comment 4 Eugene Kanter 2002-08-08 19:17:43 UTC
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.

Comment 5 Elliot Lee 2002-08-13 11:32:40 UTC
Try ftp://people.redhat.com/sopwith/3.0pl1-5/
(will also be in rawhide).

Comment 6 Eugene Kanter 2002-08-15 01:38:41 UTC
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.


Comment 7 Jay Turner 2002-08-22 12:43:39 UTC
Re-assigning this, as it still appears that we have some problems.

Comment 8 Elliot Lee 2002-08-22 13:09:34 UTC
And they are?

Comment 9 Eugene Kanter 2002-08-22 14:29:59 UTC
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.

Comment 10 Elliot Lee 2002-08-22 14:34:10 UTC
You don't find it at line 131 of dhclient-3.0pl1-7?


Comment 11 Eugene Kanter 2002-08-22 14:51:18 UTC
As my note says I only tested -5. Does the current latest beta have -7? If yes,
I'll get it soon and verify.

Comment 12 Eugene Kanter 2002-08-23 01:57:11 UTC
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.

Comment 13 Elliot Lee 2002-08-23 14:00:58 UTC
Does the nis-domain option show in /var/lib/dhcp/dhclient-eth0.leases?

Comment 14 Eugene Kanter 2002-08-24 02:31:27 UTC
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.


Comment 15 Elliot Lee 2002-08-26 11:01:15 UTC
initscripts-6.90-1 has something for the [ -w ... ] test.

I'll change default_requested_options, thanks for looking into it.

Comment 16 Elliot Lee 2002-08-26 13:11:07 UTC
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).

Comment 17 Eugene Kanter 2002-08-26 15:04:26 UTC
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.


Comment 18 Elliot Lee 2002-08-26 15:13:11 UTC
6.90 definitely has a block following that handles the case where the file doesn't exist.

Comment 19 Eugene Kanter 2002-08-26 15:21:53 UTC
Ok, I was not looking far enough. I see the extra block now. Thank you.

Comment 20 Jay Turner 2002-08-29 12:07:25 UTC
Eugene, looks like -9 is available from Rawhide, would you mind taking a crack
at that and seeing if it still suites your needs?

Comment 21 Eugene Kanter 2002-08-29 14:57:59 UTC
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.

Comment 22 Eugene Kanter 2002-09-06 16:02:33 UTC
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.

Comment 23 Daniel Walsh 2003-01-24 21:40:22 UTC
I am going to close this bug as fixed.  If parts are not fixed please enter new
bug reports.

Dan


Note You need to log in before you can comment on or make changes to this bug.