Bug 7498 - pump and $DHCP_HOSTNAME
pump and $DHCP_HOSTNAME
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: pump (Show other bugs)
6.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Erik Troan
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-12-01 17:44 EST by dbelliz
Modified: 2008-05-01 11:37 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-23 15:53:28 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 dbelliz 1999-12-01 17:44:58 EST
My company's DNS is updated via Windows NT DHCP servers. When ifup is run
at startup it was not running with the -h $DHCP_HOSTNAME.

I found out $DHCP_HOSTNAME was not getting defined. The ifup code says

if [ -n "$PUMP" ]; then
    PUMPARGS=
    if [ -n "$DHCP_HOSTNAME" ]; then
       PUMPARGS="-h $DHCP_HOSTNAME"
    fi
    echo -n "Determining IP information for $DEVICE..."
    if /sbin/pump $PUMPARGS -i $DEVICE ; then
	echo " done."
    else
	echo " failed."
	exit 1
    fi

$DHCP_HOSTNAME was never defined so pump never ran with -h $DHCP_HOSTNAME.
I added "export DHCP_HOSTNAME=myhost" to /etc/sysconfig/network (it seemed
the best place to put it) and changed the ifup code to look like below.

if [ -n "$PUMP" ]; then
    # Read in config data.
    if [ -f /etc/sysconfig/network ]; then
        . /etc/sysconfig/network
    fi
    PUMPARGS=
    if [ -n "$DHCP_HOSTNAME" ]; then
       PUMPARGS="-h $DHCP_HOSTNAME"
    fi
    echo -n "Determining IP information for $DEVICE..."
    if /sbin/pump $PUMPARGS -i $DEVICE ; then
	echo " done."
    else
	echo " failed."
	exit 1
    fi

Now my process list looks like
230 ?        S      0:00 /sbin/pump -h myhost -i eth0

The DHCP server show that a lease exists with myhost as the host name.

When my DHCP address is is renewed the DHCP lease no longer contains a
hostname.
Comment 1 dbelliz 1999-12-04 04:57:59 EST
I have come up with a cleaner way of getting pump to run with the -h param.

 if [ -n "$PUMP" ]; then
     PUMPARGS=
     if [ -f /etc/HOSTNAME ]; then
         DHCP_HOSTNAME=`awk -F'.' '{print $1}' /etc/HOSTNAME`
     }
     if [ -n "$DHCP_HOSTNAME" ]; then
        PUMPARGS="-h $DHCP_HOSTNAME"
     fi
Comment 2 dbelliz 1999-12-11 23:34:59 EST
FYI
Have tried the new pump. Pump now pushes the hostname upon renewal when the -h
parameter is specified. However the hostname is the FQDN. So while other MS
boxes showup in the DHCPADMIN tool as just hostname, RH 6.1 systems with the new
pump code show up as hostname.domain.com. If DNS is updated via DHCP, DNS
entries will look like hostname.domain.com.domain.com.

The current workaround is to change the HOSTNAME entry in /etc/sysconfig/network
to hostname from hostname.domain.com.

Many thanks to Erik T. at RH for getting RH working in MS DHCP environments.
Comment 3 roy 2000-02-13 18:27:59 EST
I have Qbik wingate 3.0.5 running on NT4 and have modified ifup as below

if [ -n "$PUMP" ]; then
     PUMPARGS=
     if [ -f /etc/HOSTNAME ]; then
         DHCP_HOSTNAME=`awk -F'.' '{print $1}' /etc/HOSTNAME`

     if [ -n "$DHCP_HOSTNAME" ]; then
        PUMPARGS="-h $DHCP_HOSTNAME"
     fi

This passes the host name to wingate DHCP but the hostname logged always has
"3|" appended to the name so zippy becomes zippy3| the"|" being a non printing
character.

if I run the awk on the command line the variable $DHCP_HOSTNAME contains
the correct hostname zippy
Comment 4 Erik Troan 2000-02-23 15:53:59 EST
The hostname issues should be fixed in pump0.7.8, available from
ftp://people.redhat.com/ewt/. It will also take the system's hostname (if
set), and pass that to the dhcp server, removing the need for DHCP_HOSTNAME.

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