Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 7498 - pump and $DHCP_HOSTNAME
Summary: pump and $DHCP_HOSTNAME
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: pump
Version: 6.1
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Erik Troan
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-12-01 22:44 UTC by dbelliz
Modified: 2008-05-01 15:37 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-02-23 20:53:28 UTC


Attachments (Terms of Use)

Description dbelliz 1999-12-01 22:44:58 UTC
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 09:57:59 UTC
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-12 04:34:59 UTC
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 23:27:59 UTC
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 20:53:59 UTC
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.