Bug 443945 - bad hostname processing in rc.sysinit
bad hostname processing in rc.sysinit
Product: Fedora
Classification: Fedora
Component: initscripts (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Bill Nottingham
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2008-04-24 05:13 EDT by JW
Modified: 2014-03-16 23:14 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-03-23 13:25:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description JW 2008-04-24 05:13:58 EDT
Description of problem:
In rc.sysinit there is a line which attempt to discover an ip address and
thereby a suitable hostname, but unfortunately the awk expression can return
multiple ip addresses which results in subsequent ipcalc failure.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. read /etc/rc.d/rc.sysinit line 560 approx.
2. run that line on a multihomed system
Actual results:
1. Yuk! Can return multiple ip addresses
2. On my system:

Expected results:
1. Should not return multiple ip addresses
2. Should try each ip until success

Additional info:
Should be something like this:

for ipaddr in $(ip addr show to 0/0 scope global | awk '/[[:space:]]inet / {
print gensub("/.*","","g",$2) }'
     eval $(ipcalc -h $ipaddr 2>/dev/null)
     [ "$HOSTNAME" ] && { hostname $HOSTNAME; break; }

The ordering of interfaces is arbitary and this might not always produce the
best result. The comments also state that there should not be more than one
network interface active at that stage. But how about some defensive programming
and simply assume the worst. Doesn't hurt.
Comment 1 Bug Zapper 2008-11-26 05:33:42 EST
This message is a reminder that Fedora 8 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 8.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '8'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 8's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 8 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
Comment 2 iarly selbir 2009-03-22 20:30:02 EDT
This bug seems inactive.

I want keep it alive.

any feedback about?


Fedora Bugzappers volunteer triage team
Comment 3 Bill Nottingham 2009-03-23 12:29:18 EDT
It's still there.
Comment 4 Bill Nottingham 2009-03-23 13:25:59 EDT

Sorry about the delayed response.

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