Bug 22547 - ifup-post not setting hostname properly
Summary: ifup-post not setting hostname properly
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
(Show other bugs)
Version: 7.0
Hardware: i386 Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
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:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-12-19 22:57:53 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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@110.net)

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.