Bug 165785 - diskless clients cannot cope with no DNS PTR record for their IP address
diskless clients cannot cope with no DNS PTR record for their IP address
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: redhat-config-netboot (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jason Vas Dias
:
Depends On: 165735
Blocks: 156320
  Show dependency treegraph
 
Reported: 2005-08-11 23:04 EDT by Jason Vas Dias
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2005-486
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-09-28 15:39:10 EDT
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 Jason Vas Dias 2005-08-11 23:04:55 EDT
+++ This bug was initially created as a clone of Bug #165735 +++

Description of problem:

If no DNS PTR record exists for the IP address that is assigned to a 
diskless boot client, disklessrc will set the hostname to '3(NXDOMAIN' ,
which becomes the name of the snapshot directory that the client will
attempt to mount .

Any hostname that may have been set by the DHCP server is ignored.

This is a latent problem with all previous releases of 
{system,redhat}-config-netboot , and stems from this code in disklessrc:

--- disklessrc, @line 220:
#
#  Mount the snapshot directory from the server and then mount files
#  in the snapshot/files file over the the shared ones
#
IP=`/sbin/ifconfig $ETHERNET|grep inet|cut -f 2 -d ':'|cut -f 1 -d ' '`

#
# Setup the hostname for the diskless client.
#
hostname `host $IP |  sed 's/.* \(.*\)./\1/'` 2> /dev/null

if [ -z "${SNAPSHOT}" ]; then
SNAPSHOT=`hostname`
fi
---

To fix this, I propose :

1. Check if any host name was set by the dhclient session - if so, use that
   hostname.

2. If no hostname was set by the dhclient session, and the 'host $IP' lookup
   fails, and $SNAPSHOT is not null, set the hostname to $SNAPSHOT .

3. If no hostname was set by the dhclient session, and the 'host $IP' lookup
   fails, and $SNAPSHOT is null, then set the hostname to the IP address,
   because pxeboot will create a default snapshot directory named with whatever
   IP address was given as the host configuration file name, and there is a 
   chance that this will be a 32 bit IP address.  This is better than multiple
   clients using the '3(NXDOMAIN' snapshot directory.

Version-Release number of selected component (if applicable):
ALL

How reproducible:
100%

Steps to Reproduce:
Set up a boot client with no 'SNAPSHOT=' setting, to obtain an IP address 
via DHCP for which there is no DNS PTR record
  
Actual results:
Client will boot with hostname '3(NXDOMAIN' and create the snapshot
directory ${NFSSERVER}:/${CLIENT_ROOT}/snapshot/3\(NXDOMAIN

Expected results:
Client should ensure it sets its hostname and snapshot directory name to a 
unique value regardless of whether its IP address is in the DNS.
It should be possible to set the hostname for the client in the DHCP server
configuration.


Additional info:
Comment 1 Jason Vas Dias 2005-08-12 13:27:05 EDT
See comments in Bug 165735 .
Fixed in redhat-config-netboot-0.1.24-1_EL3, available from:
  http://people.redhat.com/~jvdias/redhat-config-netboot
Comment 4 Red Hat Bugzilla 2005-09-28 15:39:11 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2005-486.html

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