Bug 180451

Summary: anaconda does not set hostname during install
Product: [Fedora] Fedora Reporter: Andreas Luik <andreas.luik>
Component: anacondaAssignee: David Cantrell <dcantrell>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: rawhideCC: nick
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-09-04 19:12:36 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 Andreas Luik 2006-02-08 07:14:56 UTC
Description of problem:

anaconda does not set the hostname during install.  If "hostname" is called
from the %post script, it is always "localhost.localdomain", even after
a correct /etc/sysconfig/network file has been written.  This applies to
both DHCP/NFS as well as CDROM based installs.


Version-Release number of selected component (if applicable):
anaconda-9.1.6.8-2.RHEL

How reproducible:


Steps to Reproduce:
1. Use "hostname" command in %post section of ks.cfg, also set a hostname
in "network --device eth0 --bootproto static --ip 192.168.1.10 --netmask
255.255.255.0" --nodns --hostname myhostname" directive.
2. Run kickstart installation
  
Actual results:

3. Observe that "hostname" prints "localhost.localdomain".

Expected results:

4. "hostname" shall instead print "myhostname".

Additional info:

Comment 1 Nick Leverton 2006-06-22 13:59:37 UTC
This bug also means that %post scriptlets for the packages being installed get   
a hostname of 'localhost.localdomain'.  
  
"hostname --fqdn" doesn't work in the scriptlets either so I cannot code  
around it that way.  Any files or emails created in %post during  
installation end up with localhost.localdomain as the system's domain name  
(and remain so forever after, unless I take some action to fix them). 
  
Fortunately "hostname --fqdn" does work in the ks.cfg %post, so as a  
slightly kludgy workaround I'm calling my setup from there.  

Comment 2 Joachim Frieben 2007-01-20 16:48:38 UTC
I have encountered this bug with the latest "2.6.19" kernel based
installer "anaconda-11.2.0.13-1" from "FC devel". In my kickstart
file, the relevant entry reads:

  network --device eth0 --bootproto dhcp --hostname mypc

However, upon booting, the hostname is "dhcp-086" assigned by our
local "DHCP" server. "s-c-n" shows "localhost" as hostname.
After setting it to the correct name and saving the new settings,
the hostname is correct.

Comment 3 David Cantrell 2007-04-03 19:52:43 UTC
Changing product to Fedora Core per comment #2.  If you need this bug addressed
in a RHEL update release, please contact your TAM.

Comment 4 David Cantrell 2007-09-04 19:12:36 UTC
Fixed in Fedora Development.  Thanks.