tags 426796 + patch
thanks

Hi

Thanks a lot for this patch. Much appriciated. Will be applied
on next upload.

Best regards,

// Ola

On Sun, Aug 19, 2007 at 05:25:46PM +0100, Jochen Voss wrote:
> Hi,
> 
> this is a suggested fix for bug #426796: if the host uses 127.0.0.1 as
> a nameserver, this cannot be used as a nameserver inside the
> container.
> 
> One (partial) solution would be, to replace 127.0.0.1 with the host
> address on the interface given for the vserver subnet.  This mewthod
> could be implemented by the following patch:
> 
> ----------------------------------------------------------------------
> --- /usr/sbin/newvserver.orig 2007-04-10 04:49:31.000000000 +0100
> +++ /usr/sbin/newvserver      2007-08-19 16:59:27.000000000 +0100
> @@ -477,7 +477,10 @@
>  EOF
>  
>  # grab DNS servers from the host-server for `resolv.conf'
> -(echo search $VDOMAIN ; grep '^nameserver' /etc/resolv.conf) \
> +HOST_IP=$(ip -o addr show dev $INTERFACE primary scope global | \
> +          sed -n 's;.*inet \([^/]*\)/.*;\1;p')
> +(echo search $VDOMAIN;
> + grep '^nameserver' /etc/resolv.conf | sed "s/127.0.0.1/$HOST_IP/") \
>      > "$VROOTDIR/$VHOST/etc/resolv.conf"
>  
>  # If there is a proxy server statement in-use in the Host server, copy it 
> across
> ----------------------------------------------------------------------
> 
> This will work as long as the hosts nameserver listens on $INTERFACE.
> 
> I hope this helps,
> Jochen
> -- 
> http://seehuhn.de/



-- 
 --------------------- Ola Lundqvist ---------------------------
/  [EMAIL PROTECTED]                     Annebergsslingan 37      \
|  [EMAIL PROTECTED]                     654 65 KARLSTAD          |
|  http://opalsys.net/                 +46 (0)70-332 1551       |
\  gpg/f.p.: 7090 A92B 18FE 7994 0C36  4FE4 18A1 B1CF 0FE5 3DD9 /
 ---------------------------------------------------------------


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to