Bug 1151562 - authconfig needs to preserve myhostname in nsswitch.conf hosts entry
Summary: authconfig needs to preserve myhostname in nsswitch.conf hosts entry
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: authconfig
Version: 21
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Mraz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-10 17:18 UTC by Stephen Gallagher
Modified: 2015-12-01 22:08 UTC (History)
8 users (show)

Fixed In Version: authconfig-6.2.9-4.fc21
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-11-10 06:06:27 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1284323 0 unspecified CLOSED setup: add nss_myhostname to /etc/nsswitch.conf 2022-03-21 13:17:37 UTC

Internal Links: 1284323

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.


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