Bug 180451 - anaconda does not set hostname during install
anaconda does not set hostname during install
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: David Cantrell
Depends On:
  Show dependency treegraph
Reported: 2006-02-08 02:14 EST by Andreas Luik
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-09-04 15:12:36 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 Andreas Luik 2006-02-08 02:14:56 EST
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):

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 --netmask" --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 09:59:37 EDT
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 11:48:38 EST
I have encountered this bug with the latest "2.6.19" kernel based
installer "anaconda-" 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 15:52:43 EDT
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 15:12:36 EDT
Fixed in Fedora Development.  Thanks.

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