Bug 977635

Summary: Hostname set by kickstart for DHCP does not survive reboot
Product: [Fedora] Fedora Reporter: Martin Jackson <mhjacks>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: anaconda-maint-list, dshea, g.kaviyarasu, jonathan, mkolman, rvykydal, sbueno, SpikeFedora, vanmeeuwen+fedora
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-31 04:05:21 EDT Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Martin Jackson 2013-06-24 23:10:55 EDT
Description of problem:
When setting a hostname for a DHCP interface in kickstart, the desired hostname is not set as static hostname, and does not survive reboot into the installed system.  If the hostname is configured via the interactive graphical interface, it behaves as expected (the hostname is preserved in the installed system).

My DHCP server is ISC, and is not sending the hostname, but constructs a hostname in the absence of one being sent.  It seems my installation is picking this up from doing a reverse lookup of its IP and setting that as the static hostname.

Version-Release number of selected component (if applicable): anaconda-19.30.9-1.fc19.x86_64


How reproducible:  Every time.


Steps to Reproduce:
1.  Construct a kickstart file with network declarations like so:
network  --bootproto=dhcp --device=eth0 --noipv6 --activate
network  --hostname=lotho.minas.tirith

2.
3.

Actual results:  hostnamectl in the installed system should show "lotho.minas.tirith"


Expected results: hostnamectl in the installed system shows "client-525400391749.minas.tirith"


Additional info:  I've been doing my tests with a network install of the FC19 TC6 DVD install in KVM using virt-manager.
Comment 1 Martin Jackson 2013-06-24 23:36:31 EDT
I have found a workaround, it seems.  With the following %post script I get the desired result:

%post
echo "lotho.minas.tirith" > /etc/hostname
%end

But with the following %post script I do not:

%post
hostnamectl set-hostname "lotho.minas.tirith"
%end
Comment 2 Radek Vykydal 2013-07-31 04:05:21 EDT

*** This bug has been marked as a duplicate of bug 981934 ***