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

From: Roderick A. Anderson <raanders_at_acm.org>
Date: Tue 12 Feb 2008 - 19:35:17 GMT
Message-ID: <47B1F4F5.2040403@acm.org>

Daniel Hokka Zakrisson wrote:
> 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.

OK I have "cat /proc/vserverion":

Linux version 2.6.22.10-vs2.3.0.29.1 (mockbuild@x86.builders.hozac.com)
(gcc version 4.1.1 20070105 (Red Hat 4.1.1-52)) #1 SMP Wed Oct 31
10:48:21 EDT 2007

Sounds better all the time. Is this set (or how do I check) in the
kernels you're building?

And so I'm thinking the errors I'm seeing are in reaction to no entry in
/etc/hosts for localhost or /etc/hosts does not exist.

Rod

-- 
> 
Received on Tue Feb 12 19:33:49 2008
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Tue 12 Feb 2008 - 19:33:54 GMT by hypermail 2.1.8