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.
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.
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.
E.g. this works: # hostnamectl --pretty set-hostname "Fedora 19"
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 ~]#
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.
How about letting the user decide what is "pretty" and what is not?
Fixed in git. The commands from the original bug and comment #4 work as expected now.
Thank you.
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
Oops, now I see that it is corrected in the updates available for Beta TC4. Sorry.
Why does not: hostnamectl --pretty set-hostname "IPA" work in the Anaconda Kickstart post script?
*** Bug 975277 has been marked as a duplicate of this bug. ***
I have verified that the problem is resolved in systemd-204-9.fc19.x86_64.
But it does not work in systemd-201-2.fc18.7.x86_64.
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.