Bug 1134404

Summary: non-persistent hostname is set to 'short' hostname
Product: [Fedora] Fedora EPEL Reporter: Siert Z. <sgzijl>
Component: cloud-initAssignee: Pádraig Brady <p>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: el6CC: apevec, bugs, gholms, Jan.van.Eldik, luis.fernandez.alvarez, p, sgzijl, s
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: 2019-08-29 15:31:28 UTC Type: Bug
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
Fix set_hostname none

Description Siert Z. 2014-08-27 13:03:08 UTC
Created attachment 931457 [details]
Fix set_hostname

Description of problem:

Distro.set_hostname() uses wrong hostname when calling _apply_hostname().

On initial boot, the hostname is set to the short name, but after reboot it is set to the fqdn. 

Version-Release number of selected component (if applicable):

  0.7.4-2

How reproducible:

  On openstack or AWS, use the following user data:

    #cloud-config
    manage_etc_hosts: true
    hostname: myhostname
    fqdn: myhostname.domain.tld

  Launch the machine and login. Then run hostname:

    [root@myhostname ~]# hostname
    myhostname

  Reboot.

  Login and run hostname again:

  [root@myhostname ~]# hostname
  myhostname.domain.tld


Expected results:

  [root@myhostname ~]# hostname
  myhostname.domain.tld
  
Additional info:

Patch attached works against current version in EPEL.

Comment 1 Luis Fernández Álvarez 2014-11-25 15:43:51 UTC
Hi,

Any update on this bug? It's really simple and solves the problem.

Could it be shipped in the next release?

Comment 2 Jan van Eldik 2015-02-20 12:38:43 UTC
Hi,

A fix has been committed upstream to address this issue. Are we getting closer to a fix in the EPEL RPM, or is an upstream release required?

Thanks!

Comment 3 Matej Susta 2015-03-23 16:53:49 UTC
There's a cloud-init-0:0.7.5-10.el6.centos.2.x86_64 available in centos-extras repository.

Comment 4 Dusty Mabe 2019-08-29 15:31:28 UTC
This package is no longer included in epel7. https://src.fedoraproject.org/rpms/cloud-init/c/aeebc66ebb93afe224cc4752a58955dad03a5dde?branch=epel7