Bug 1151562

Summary: authconfig needs to preserve myhostname in nsswitch.conf hosts entry
Product: [Fedora] Fedora Reporter: Stephen Gallagher <sgallagh>
Component: authconfigAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 21CC: codonell, jakub, jlieskov, law, pfrankli, sgallagh, spoyarek, tmraz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: authconfig-6.2.9-4.fc21 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-10 06:06:27 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:

Description Stephen Gallagher 2014-10-10 17:18:41 UTC
Description of problem:
systemd now provides an NSS module for doing lookups of the machine hostname. This module, nss_myhostname.so.2 is extremely handy and should be the default on the system so that services can always find the address of the current machine by its hostname.

Version-Release number of selected component (if applicable):
glibc-2.20-5.fc21.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Install Fedora
2. hostnamectl set-hostname <something>
3. getent hosts <something>

Actual results:
Nothing

Expected results:
The IP addresses of the machine.

Additional info:

Among other things, this simplifies a common setup problem for FreeIPA, which is that in order to set it up, there needs to be forward and reverse host information available.

Comment 1 Carlos O'Donell 2014-10-10 20:32:15 UTC
Stephen,

Sorry, I don't quite understand what's missing.

Fedora 21 should have had libnss_myhostname.so.2 provided by systemd-libs, and the install should have added myhostname to the end of `hosts:` in /etc/nsswitch.conf.

Given that Fedora should have systemd-libs installed by default, I would expect myhostname to be installed by default and work correctly.

On my F20 system I have libnss_myhostname.so.2 installed from systemd-libs, and it correctly configured /etc/nsswitch.conf e.g. `hosts:      files dns mdns4_minimal myhostname` such that `getent hosts <hostname>` returns all the configured IP addresses of the machine.

What's missing?

Comment 2 Stephen Gallagher 2014-10-11 13:40:33 UTC
What's missing is that a default install of Fedora (21) does not have this in the nsswitch.conf when it boots up after installation. If this is part of the defaults in the package, then something is removing it during installation. We need to track this down and fix it.

CCing Tomas Meaz in case this is an authconfig issue.

Comment 3 Tomas Mraz 2014-10-13 08:35:29 UTC
nsswitch.conf is still managed by authconfig so if any package wants to add some entry to it by default it needs to have this change added to authconfig as well.

So this is basically problem of systemd-libs guys that they did not notify me about this new requirement for authconfig.

Now that I know about this requirement, I can add it.

Comment 4 Stephen Gallagher 2014-11-03 20:52:08 UTC
Tomas, would you please add this soon so we can verify it and make sure it's ready for Fedora 21 Final? This is a really useful feature (and makes setting up FreeIPA somewhat easier).

Comment 5 Fedora Update System 2014-11-04 11:11:11 UTC
authconfig-6.2.9-4.fc21 has been submitted as an update for Fedora 21.
https://admin.fedoraproject.org/updates/authconfig-6.2.9-4.fc21

Comment 6 Fedora Update System 2014-11-05 19:26:01 UTC
Package authconfig-6.2.9-4.fc21:
* should fix your issue,
* was pushed to the Fedora 21 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing authconfig-6.2.9-4.fc21'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-14343/authconfig-6.2.9-4.fc21
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2014-11-10 06:06:27 UTC
authconfig-6.2.9-4.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.