schroot fails to resolve localhost in the absence of internet connection

Bug #744704 reported by Chow Loong Jin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
New
Undecided
Unassigned
schroot (Ubuntu)
New
Undecided
Unassigned

Bug Description

  affects ubuntu/eglibc
  affects ubuntu/schroot

In the absence of an Internet connection, nothing in a spawned schroot seems to
be able to resolve localhost. Connecting to 127.0.0.1 fails too.

The reason for this is that NetworkManager adds the following entry to
/etc/hosts, if it was not already present:
::1 $HOSTNAME localhost6.localdomain6 localhost6

`getent hosts` then shows two 127.0.0.1 entries:-
127.0.0.1 localhost.localdomain localhost
127.0.0.1 $HOSTNAME localhost6.localdomain6 localhost6

And /etc/schroot/setup.d/20nssdatabases then dumps this output into the
schroot's /etc/hosts during the setup process.

I don't know why this even works when there's an internet connection, but having
multiple 127.0.0.1 entries in /etc/hosts is definitely malformed and should be
fixed.

There appears to be some discussion about getent and IPv6[1] which mentions that
"getent ipnodes" should be used instead, but ipnodes doesn't seem to be a
supported database by Ubuntu's getent:-

hyperair@ipwn:~% getent ipnodes localhost6 [10:34AM]
Unknown database: ipnodes

[1] http://<email address hidden>/msg11440.html

--
Kind regards,
Loong Jin

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.