Bug 392691

Summary: ifup-post setups hostname with no user option controlling it
Product: Red Hat Enterprise Linux 5 Reporter: Dan Fruehauf <dan>
Component: initscriptsAssignee: initscripts Maintenance Team <initscripts-maint-list>
Status: CLOSED NOTABUG QA Contact: Brock Organ <borgan>
Severity: low Docs Contact:
Priority: low    
Version: 5.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-20 17:16:39 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:
Attachments:
Description Flags
Patch to network-functions to enable the NEED_HOSTNAME flag none

Description Dan Fruehauf 2007-11-20 16:46:33 UTC
Description of problem:
ifup sets a hostname for eth interfaces and the user has no control of it.

Version-Release number of selected component (if applicable):
initscripts-8.45.17.EL-1

How reproducible:
Have a eth interface connected to the internet and set it up with a static IP
address.
Have a PTR record for this IP address.
Make sure your domain name is one of 'localhost' or 'localhost.localdomain' and
start the interface.

Steps to Reproduce:
1. ifup eth0
  
Actual results:
Your hostname changes to the value in the PTR record

Expected results:
Well, it should change, but we need some control over it, because for some
reason a user would like it to stay localhost.localdomain or just localhost.
I suggest adding a NEED_HOSTNAME value in each interface configured.
In case it's NEED_CONFIG=no, we won't calculate a new hostname for it.
I'm suggesting a patch to resolve that issue for the file
/etc/sysconfig/network-scripts/network-functions.
The patch is in front of 

Additional info:
On ppp and plip interfates this does not happen (witness it in
/etc/sysconfig/network-scripts/ifup-post).

Comment 1 Dan Fruehauf 2007-11-20 16:46:33 UTC
Created attachment 265101 [details]
Patch to network-functions to enable the NEED_HOSTNAME flag

Comment 2 Bill Nottingham 2007-11-20 16:53:37 UTC
Why would you want to keep a localhost hostname?

Comment 3 Dan Fruehauf 2007-11-20 17:11:19 UTC
My case is configuring a computer with certain settings.
Then later connecting it to the Internet and suddenly getting a new hostname.
Some applications / settings which depended on it failed to run.

I believe that this unexpected / surprising hostname change is somewhat
problematic. Besides, the suggested patch does not interfere with any other
behavior which is currently implemented.

Comment 4 Bill Nottingham 2007-11-20 17:16:39 UTC
This is expected behavior in pretty much every release since the old Red Hat
Linux days - if a static hostname is expected, just setting it to something
other than localhost should do the trick.

Comment 5 Dan Fruehauf 2007-11-20 17:28:29 UTC
Expected behavior is preserved but more flexibility is added.
I would like to keep a localhost.localdomain hostname regardless of what's
happening. It's not that awkward.