Bug 10155

Summary: ifup does not set hostname when using DHCP and hostname not already set.
Product: [Retired] Red Hat Linux Reporter: Greg Retkowski <greg>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-03-20 16:07:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Greg Retkowski 2000-03-13 22:47:50 UTC
/sbin/ifup does not automatically set the machine's hostname if the machine
is configured to use DHCP and does not have a hostname set in
/etc/sysconfig/network. Although /sbin/ifup runs the 'need_hostname' script
(sourced from network-functions) it never uses the NEEDHOSTNAME variable to
take measures to assign a hostname from DNS if none is present.

The hostname not being set results in problems including sendmail failing
to send messages by SMTP as most SMTP servers reject 'HELO (none)' apon
initiation of message transfer.

A patch to /sbin/ifup follows:

--- /tmp/ifup.orig	Mon Mar 13 22:48:31 2000
+++ /sbin/ifup	Mon Mar 13 22:48:57 2000
@@ -87,6 +87,9 @@
     if [ -n "$DHCP_HOSTNAME" ]; then
        PUMPARGS="-h $DHCP_HOSTNAME"
     fi
+    if [ -n "$NEEDHOSTNAME" ]; then
+       PUMPARGS="$PUMPARGS --lookup-hostname"
+    fi
     echo -n "Determining IP information for $DEVICE..."
     if /sbin/pump $PUMPARGS -i $DEVICE ; then
 	echo " done."

Comment 1 Bill Nottingham 2000-03-20 16:07:59 UTC
fixed as of initscripts-5.02-1.