schroot fails to resolve localhost in the absence of internet connection
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.
`getent hosts` then shows two 127.0.0.1 entries:-
127.0.0.1 localhost.
127.0.0.1 $HOSTNAME localhost6.
And /etc/schroot/
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>
--
Kind regards,
Loong Jin