Re: [vserver] localhost - The Cliff Notes version?

From: Daniel Hokka Zakrisson <daniel_at_hozac.com>
Date: Tue 12 Feb 2008 - 17:46:44 GMT
Message-ID: <46203.192.168.101.12.1202838404.squirrel@intranet>

Roderick A. Anderson wrote:
> OK, I'm sorry to open this can of worms again but I can't get my head
> wrapped around the localhost (127.0.0.1) in guests thing.
>
> I have guests running PostgreSQL and postfix. Both _would_ like a (or
> rather pitch a bitch if there is no) localhost entry when they are
> installed or an attempt is made to start them.
>
> I've hacked my way through this but I think from watching this list
> there must be an easier way to get around the messages/errors.
>
> So in "user-dummy{1}" terms can anyone offer a solution to making
> localhost auto-magically work?
>
> I see that all the 127.0.0. IPs ping from inside a guest but I don't
> want to do anything that will cause the host or other guests to die or,
> for that matter, the universe to end if I just put a "localhost" entry
> in /etc/hosts.

It's really very simple. For Linux-VServer versions <2.3, 127.0.0.1 is
rewritten on connect/bind to the guest's first IP address. If
CONFIG_VSERVER_REMAP_SADDR is set, the source address will be rewritten as
well (for connect). Only applications that have hardcoded checks using
getsockname/getpeername against 127.0.0.1 will ever notice it happened.

For Linux-VServer versions >=2.3, there is a separate lback address. If
CONFIG_VSERVER_AUTO_LBACK is enabled, the assignment is handled
automatically. The lback address is used, just like in the older versions,
when binding or connecting to 127.0.0.1. It's remapped for both source and
destination addresses, and, this is the big difference vs. <2.2, it's
remapped back to 127.0.0.1 whenever userspace asks. This is supposed to be
completely invisible to userspace.

-- 
Daniel Hokka Zakrisson
Received on Tue Feb 12 17:47:01 2008
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 12 Feb 2008 - 17:47:07 GMT by hypermail 2.1.8