Bug 17585 - hostname allocation
hostname allocation
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-18 07:21 EDT by Won-kyu Park
Modified: 2008-05-01 11:37 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-07-16 09:41:38 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 Won-kyu Park 2000-09-18 07:21:18 EDT
I think, pump with --lookup-hostname is not correctly implemented.

* Pump version: 0.7.11

I want auto configuation at boot time, then I set the network option

as...
/etc/sysconfig/network
-----
NETWORK="yes"
---------
/etc/sysconfig/network-scripts/ifcfg-eth0
-----
ONBOOT="yes"
BOOTPROTO="bootp"
DEVICE="eth0"
-----

All looks good, but hostname,domainname are incorrect.

In /etc/sysconfig/network-scripts/ifup script, hostname maybe retrived with pump using "--lookup-hostname" option.
But, hostname is not setted with below manner..

[...]
    if [ -n "$NEEDHOSTNAME" ]; then
       PUMPARGS="$PUMPARGS --lookup-hostname"
       DHCPCDARGS="$DHCPCDARGS -H"
    fi
[...]

I see, the pump source, and I found, there is no using 'sethostname', or 'setdomainname'

This is my quick hack for correct hostname/domainname retriving.

--------------
--- pump-0.7.11/dhcp.c	Tue Jul  4 14:27:04 2000
+++ pump-0.7.11.new/dhcp.c	Mon Sep 18 17:50:30 2000
@@ -1305,8 +1305,8 @@
     close(s);
 
     parseReply(&bresp, intf);
-    if (flags & PUMP_FLAG_FORCEHNLOOKUP)
-	intf->set &= ~(PUMP_NETINFO_HAS_DOMAIN | PUMP_NETINFO_HAS_HOSTNAME);
+//    if (flags & PUMP_FLAG_FORCEHNLOOKUP) /* XXX */
+//	intf->set &= ~(PUMP_NETINFO_HAS_DOMAIN | PUMP_NETINFO_HAS_HOSTNAME);
 
     return NULL;
 }
diff -ru pump-0.7.11/pump.c pump-0.7.11.new/pump.c
--- pump-0.7.11/pump.c	Fri Feb 18 00:15:48 2000
+++ pump-0.7.11.new/pump.c	Mon Sep 18 18:32:04 2000
@@ -410,6 +410,16 @@
 		} else {
 		    pumpSetupInterface(intf + numInterfaces);
 
+		    if (intf[numInterfaces].set & PUMP_NETINFO_HAS_HOSTNAME) {
+			sethostname(intf[numInterfaces].hostname,
+				strlen(intf[numInterfaces].hostname));
+			syslog(LOG_INFO, "HOST %s (%d)", 
intf[numInterfaces].hostname,strlen(intf[numInterfaces].hostname));
+		    }
+		    if (intf[numInterfaces].set & PUMP_NETINFO_HAS_DOMAIN) {
+			setdomainname(intf[numInterfaces].domain,
+				strlen(intf[numInterfaces].domain));
+			syslog(LOG_INFO, "DOMAIN %s", intf[numInterfaces].domain);
+		    }
 		    syslog(LOG_INFO, "configured interface %s", intf->device);
 
 		    if (intf->set & PUMP_NETINFO_HAS_GATEWAY) {
Comment 1 Elliot Lee 2001-07-19 18:20:32 EDT
The hostname is only retrieved - it is the responsibility of the initscripts or
whatever to actually set them.

FWIW setdomainname() isn't going to do what you think it is.

Apologies for the unresponsiveness of the previous pump maintainer...

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