Bug 10155 - ifup does not set hostname when using DHCP and hostname not already set.
Summary: ifup does not set hostname when using DHCP and hostname not already set.
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts   
(Show other bugs)
Version: 6.1
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-03-13 22:47 UTC by Greg Retkowski
Modified: 2014-03-17 02:13 UTC (History)
1 user (show)

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: ---


Attachments (Terms of Use)

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.


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