Bug 22547 - ifup-post not setting hostname properly
Summary: ifup-post not setting hostname properly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-19 20:43 UTC by jim_collins
Modified: 2014-03-17 02:17 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-12-19 22:57:53 UTC
Embargoed:


Attachments (Terms of Use)

Description jim_collins 2000-12-19 20:43:27 UTC
In ifup-post, there appears to be a scope issue with the construct:

eval `/bin/ipcalc --silent --hostname ${IPADDR}` && set_hostname $HOSTNAME

The set_hostname function does not get handed the value of $HOSTNAME as is
set by the eval, instead uses $HOSTNAME as it exists before the eval.
In my case, I have HOSTNAME set to "localhost" to force hostname to be
set to the fqdn of the IP the DHCP server hands it. As a result of the
above mentioned problem, the hostname never gets set. I can provide bash -x
output of this if you need.

I have resolved this on my setup via (lame but easy):

eval `/bin/ipcalc --silent --hostname ${IPADDR}` && HOSTNAME=`/bin/ipcalc
--silent --hostname ${IPADDR}|sed s/HOSTNAME=//` && set_hostname $HOSTNAME

- Jim Collins (jim_collins)

Comment 1 Bill Nottingham 2000-12-26 05:54:17 UTC
Will be fixed in initscripts-5.54-1; thanks for the report.


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