Bug 443945 - bad hostname processing in rc.sysinit
Summary: bad hostname processing in rc.sysinit
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts   
(Show other bugs)
Version: 10
Hardware: All Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2008-04-24 09:13 UTC by JW
Modified: 2014-03-17 03:14 UTC (History)
2 users (show)

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

Attachments (Terms of Use)

Description JW 2008-04-24 09:13:58 UTC
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 10:33:42 UTC
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-23 00:30:02 UTC
This bug seems inactive.

I want keep it alive.

any feedback about?


Fedora Bugzappers volunteer triage team

Comment 3 Bill Nottingham 2009-03-23 16:29:18 UTC
It's still there.

Comment 4 Bill Nottingham 2009-03-23 17:25:59 UTC

Sorry about the delayed response.

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