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