Bug 22547

Summary: ifup-post not setting hostname properly
Product: [Retired] Red Hat Linux Reporter: jim_collins
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dr, rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

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.