Bug 68650 - host name and NIS domain is not been set like in 7.3
host name and NIS domain is not been set like in 7.3
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: dhcp (Show other bugs)
8.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Daniel Walsh
:
Depends On:
Blocks: 67218 79579
  Show dependency treegraph
 
Reported: 2002-07-11 22:35 EDT by Eugene Kanter
Modified: 2008-05-01 11:38 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2003-01-24 16:40:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Eugene Kanter 2002-07-11 22:35:23 EDT
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 18:06:25 EDT
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 11:44:44 EDT
You can use VMWARE ....
Comment 3 Elliot Lee 2002-08-08 11:12:31 EDT
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 15:17:43 EDT
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 07:32:40 EDT
Try ftp://people.redhat.com/sopwith/3.0pl1-5/
(will also be in rawhide).
Comment 6 Eugene Kanter 2002-08-14 21:38:41 EDT
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 08:43:39 EDT
Re-assigning this, as it still appears that we have some problems.
Comment 8 Elliot Lee 2002-08-22 09:09:34 EDT
And they are?
Comment 9 Eugene Kanter 2002-08-22 10:29:59 EDT
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 10:34:10 EDT
You don't find it at line 131 of dhclient-3.0pl1-7?
Comment 11 Eugene Kanter 2002-08-22 10:51:18 EDT
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-22 21:57:11 EDT
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 10:00:58 EDT
Does the nis-domain option show in /var/lib/dhcp/dhclient-eth0.leases?
Comment 14 Eugene Kanter 2002-08-23 22:31:27 EDT
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 07:01:15 EDT
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 09:11:07 EDT
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 11:04:26 EDT
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 11:13:11 EDT
6.90 definitely has a block following that handles the case where the file doesn't exist.
Comment 19 Eugene Kanter 2002-08-26 11:21:53 EDT
Ok, I was not looking far enough. I see the extra block now. Thank you.
Comment 20 Jay Turner 2002-08-29 08:07:25 EDT
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 10:57:59 EDT
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 12:02:33 EDT
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 16:40:22 EST
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.