Bug 22547 - ifup-post not setting hostname properly
ifup-post not setting hostname properly
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-12-19 15:43 EST by jim_collins
Modified: 2014-03-16 22:17 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-12-19 17:57:53 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 jim_collins 2000-12-19 15:43:27 EST
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@110.net)
Comment 1 Bill Nottingham 2000-12-26 00:54:17 EST
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.