Red Hat Bugzilla – Bug 180451
anaconda does not set hostname during install
Last modified: 2007-11-30 17:11:23 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):
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
3. Observe that "hostname" prints "localhost.localdomain".
4. "hostname" shall instead print "myhostname".
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.
I have encountered this bug with the latest "2.6.19" kernel based
installer "anaconda-18.104.22.168-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.
Changing product to Fedora Core per comment #2. If you need this bug addressed
in a RHEL update release, please contact your TAM.
Fixed in Fedora Development. Thanks.