Bug 957814 - hostnamectl --pretty set-hostname Fedora19
Summary: hostnamectl --pretty set-hostname Fedora19
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 18
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 975277 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-04-29 15:13 UTC by Dean Hunter
Modified: 2013-12-23 04:15 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-23 04:15:00 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dean Hunter 2013-04-29 15:13:11 UTC
Description of problem:

"hostnamectl --pretty set-hostname Fedora19" does not change the pretty host name.


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

systemd-202-3.fc19.x86_64


How reproducible: Consistent


Steps to Reproduce:

hostnamectl --pretty set-hostname Fedora19


Actual results:

[root@fedora19 ~]# hostnamectl
   Static hostname: fedora19.hunter.org
   Pretty hostname: n/a
         Icon name: computer
           Chassis: n/a
        Machine ID: 13ec49adfd2fabd13665f1eec8c2ac40
           Boot ID: 4f459102707540deab2becda8cb70c44
    Virtualization: kvm
  Operating System: Fedora 19 (Schrödinger’s Cat)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.9.0-0.rc8.git0.2.fc19.x86_64
      Architecture: x86_64
[root@fedora19 ~]# hostnamectl --pretty set-hostname Fedora19
[root@fedora19 ~]# hostnamectl
   Static hostname: fedora19.hunter.org
   Pretty hostname: n/a
         Icon name: computer
           Chassis: n/a
        Machine ID: 13ec49adfd2fabd13665f1eec8c2ac40
           Boot ID: 4f459102707540deab2becda8cb70c44
    Virtualization: kvm
  Operating System: Fedora 19 (Schrödinger’s Cat)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.9.0-0.rc8.git0.2.fc19.x86_64
      Architecture: x86_64
[root@fedora19 ~]# 


Expected results:

[root@fedora19 ~]# hostnamectl
   Static hostname: fedora19.hunter.org
   Pretty hostname: n/a
         Icon name: computer
           Chassis: n/a
        Machine ID: 13ec49adfd2fabd13665f1eec8c2ac40
           Boot ID: 4f459102707540deab2becda8cb70c44
    Virtualization: kvm
  Operating System: Fedora 19 (Schrödinger’s Cat)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.9.0-0.rc8.git0.2.fc19.x86_64
      Architecture: x86_64
[root@fedora19 ~]# hostnamectl --pretty set-hostname Fedora19
[root@fedora19 ~]# hostnamectl
   Static hostname: fedora19.hunter.org
   Pretty hostname: Fedora19
         Icon name: computer
           Chassis: n/a
        Machine ID: 13ec49adfd2fabd13665f1eec8c2ac40
           Boot ID: 4f459102707540deab2becda8cb70c44
    Virtualization: kvm
  Operating System: Fedora 19 (Schrödinger’s Cat)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.9.0-0.rc8.git0.2.fc19.x86_64
      Architecture: x86_64
[root@fedora19 ~]# 


Additional info:

This had been working in Fedora 18 until a recent change.

Comment 1 Harald Hoyer 2013-04-29 15:47:24 UTC
From the code:

 /* If the passed hostname is already valid, then
  * assume the user doesn't know anything about pretty
  * hostnames, so let's unset the pretty hostname, and
  * just set the passed hostname as static/dynamic
  * hostname. */


http://cgit.freedesktop.org/systemd/systemd/commit/?id=fda2c5d28bdf5c6ac1ff1ba504fa884c48ed1439

If people are unaware or uninterested in the concept of pretty host names, and simply invoke "hostnamectl set-hostname" for a valid internet host name, then use this as indication to unset the pretty host name and only set the static/dynamic one. This also allows fqdn, hence "hostnamectl set-hostname www.foobar.com" will just work if people really insist on using fqdns as hostnames.

Comment 2 Dean Hunter 2013-04-29 21:00:59 UTC
What???

This means that sometime after Fedora 18 was released y'all decided that if the static host name was set that I could not set the pretty host name. This make no sense. Why change it? The static and pretty host names are used in different places.

I can understand defaulting to set the static host name if --static or --pretty is not specified. I do not understand not allowing both to be set.

FYI, I do not insist on using a fully qualified host name as the static host name. Anaconda did it.

Comment 3 Harald Hoyer 2013-04-30 07:35:31 UTC
E.g. this works:

# hostnamectl --pretty set-hostname "Fedora 19"

Comment 4 Dean Hunter 2013-04-30 13:20:31 UTC
But this does not:

[root@developer ~]# hostnamectl
   Static hostname: developer.hunter.org
   Pretty hostname: n/a
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: b76ca95e7261492eb8c1012916eb82f7
           Boot ID: 03341463885744e99c33b1a08aebdfc9
  Operating System: Fedora 18 (Spherical Cow)
       CPE OS Name: cpe:/o:fedoraproject:fedora:18
            Kernel: Linux 3.8.9-200.fc18.x86_64
      Architecture: x86_64

[root@developer ~]# hostnamectl --pretty set-hostname "Developer"

[root@developer ~]# hostnamectl
   Static hostname: developer.hunter.org
   Pretty hostname: n/a
         Icon name: computer-desktop
           Chassis: desktop
        Machine ID: b76ca95e7261492eb8c1012916eb82f7
           Boot ID: 03341463885744e99c33b1a08aebdfc9
  Operating System: Fedora 18 (Spherical Cow)
       CPE OS Name: cpe:/o:fedoraproject:fedora:18
            Kernel: Linux 3.8.9-200.fc18.x86_64
      Architecture: x86_64

[root@developer ~]#

Comment 5 Harald Hoyer 2013-04-30 15:06:47 UTC
Yes, because it contains legal chars for a normal hostname, and also it's already part of "developer.hunter.org". No need for a "pretty" hostname.

Comment 6 Dean Hunter 2013-04-30 15:22:12 UTC
How about letting the user decide what is "pretty" and what is not?

Comment 7 Lennart Poettering 2013-05-07 19:01:03 UTC
Fixed in git. The commands from the original bug and comment #4 work as expected now.

Comment 8 Dean Hunter 2013-05-07 19:19:26 UTC
Thank you.

Comment 9 Dean Hunter 2013-05-14 15:09:24 UTC
This problem persists in Fedora 19 Beta TC4:

# Configure the host name

  hostnamectl --pretty set-hostname "IPA"
  hostnamectl
   Static hostname: ipa.hunter.org
   Pretty hostname: n/a
         Icon name: computer
           Chassis: n/a
        Machine ID: 1de1b16f867cd68bf6bda2289972de32
           Boot ID: a178d608baef49d89871b0d474e9128a
    Virtualization: kvm
  Operating System: Fedora 19 (Schrödinger’s Cat)
       CPE OS Name: cpe:/o:fedoraproject:fedora:19
            Kernel: Linux 3.9.0-301.fc19.x86_64
      Architecture: x86_64

Comment 10 Dean Hunter 2013-05-14 16:38:39 UTC
Oops, now I see that it is corrected in the updates available for Beta TC4.

Sorry.

Comment 11 Dean Hunter 2013-05-17 20:24:24 UTC
Why does not:

  hostnamectl --pretty set-hostname "IPA"

work in the Anaconda Kickstart post script?

Comment 12 Lennart Poettering 2013-06-21 14:15:13 UTC
*** Bug 975277 has been marked as a duplicate of this bug. ***

Comment 13 Dean Hunter 2013-07-02 19:27:26 UTC
I have verified that the problem is resolved in systemd-204-9.fc19.x86_64.

Comment 14 Dean Hunter 2013-07-03 00:02:34 UTC
But it does not work in systemd-201-2.fc18.7.x86_64.

Comment 15 Fedora End Of Life 2013-12-21 15:39:16 UTC
This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.


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