Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 230157 - initscripts fail to change hostname from localhost.localdomain
Summary: initscripts fail to change hostname from localhost.localdomain
Alias: None
Product: Fedora
Classification: Fedora
Component: initscripts
Version: rawhide
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
Depends On:
TreeView+ depends on / blocked
Reported: 2007-02-26 22:15 UTC by Michal Jaegermann
Modified: 2014-03-17 03:05 UTC (History)
1 user (show)

Fixed In Version: 8.52-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2007-04-16 22:44:37 UTC

Attachments (Terms of Use)
change to make ifup-post to work again (deleted)
2007-02-26 22:15 UTC, Michal Jaegermann
no flags Details | Diff

Description Michal Jaegermann 2007-02-26 22:15:24 UTC
Description of problem:

After recent initscripts update starting up a network failed to
rename a machine with a DHCP assigned address from 'localhost'.
The culprit turned out to be ifup-post.  It find address
by doing this:

 IPADDR=$(LANG=C ip -o -4 addr ls dev ${DEVICE} | awk '{ print $4 }')

If ${DEVICE} in question happen to have also some additional alias
addresses this returns all of these and makes a subsequnt call
to 'ipcalc' very unhappy.  A solution is to use only the first address
as reported by 'ip'.  A simple patch is attached.

BTW - earlier in 'ifup-post' there is the following line:

if [ "$PEERDNS" != "no" -o -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then

Is this really what is supposed to be there or rather

if [ "$PEERDNS" != "no" ] || \
     [ -n "$RESOLV_MODS" -a "$RESOLV_MODS" != "no" ]; then

was really meant?  Quite possibly what is there is fine but a logic
is surely not so clear on the first look.

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

Comment 1 Michal Jaegermann 2007-02-26 22:15:24 UTC
Created attachment 148836 [details]
change to make ifup-post to work again

Comment 2 Bill Nottingham 2007-04-16 22:44:37 UTC
Added in CVS, will be in 8.52-1. Thanks!

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