Re: [Vserver] hostname -va

2006-11-16 Thread Herbert Poetzl
On Thu, Nov 16, 2006 at 08:02:38AM +0100, Daniel Haensse wrote:
> 
> > inside of what vserver :) i.e. please provide
> > a few more details, like kernel version, tool version
> > and such
> >
> >   
> vserver1:/# uname -va
> Linux vserver1.foobar.com 2.6.17-2-vserver-amd64 #1 SMP Wed Sep 13
> 18:02:36 CEST 2006 x86_64 GNU/Linux
> virtual:~# vserver --version
> vserver 0.30.211 -- manages the state of vservers
> This program is part of util-vserver 0.30.211
> 
> It's a debian etch system installed last week, so it should 
> be up to date

well, I have no idea what vserver version is in that kernel,
but let's hope the debian folks made a good choice ...

> > let's see ...
> >   
> come on :-)
> > that one would be quite interesting to get
> > the strace from, please try something like
> >
> >   strace -fF hostname -va
> >   
> vserver1:/# strace -fF hostname -va
> execve("/bin/hostname", ["hostname", "-va"], [/* 15 vars */]) = 0
> uname({sys="Linux", node="vserver1.foobar.com", ...}) = 0
> brk(0)  = 0x503000
...
> uname({sys="Linux", node="vserver1.foobar.com", ...}) = 0
> gettimeofday({1163656218, 118761}, NULL) = 0
> getpid()= 6611
> open("/etc/resolv.conf", O_RDONLY)  = 3
...
> open("/etc/nsswitch.conf", O_RDONLY)= 3
> fstat(3, {st_mode=S_IFREG|0644, st_size=475, ...}) = 0
...
> socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 3
> connect(3, {sa_family=AF_INET, sin_port=htons(53),
> sin_addr=inet_addr("129.132.98.12")}, 28) = 0
...
> Looks like it is not happy /etc/hosts and the local dns server is
> misconfigured. Why does it resolve the name with dns when it finds a
> /etc/hosts?

that is part of the resolve mechanisms of libc
(read: you have to consult the config e.g. /etc/nsswitch.conf
and talk to the debian folks, if it doesn't do what it's 
supposed to do)

> > and provide the output ...
> >   
> >> vserver1:/# cat /etc/resolv.conf
> >> search foobar.com
> >> nameserver 192.168.5.5
> >> nameserver 129.132.98.12
> >> nameserver 129.132.250.2
> >> nameserver 129.132.250.220
> >
> > IIRC, this won't work as expected, as you can
> > only specify 3 nameservers in /etc/resolv.conf
> >   
> Sure, is there a way to update this automatically from the hosts
> (virtual) configuration (dhcp)

basically you could setup a dhcp (on the host) and
send out requests with some identifier (guest) to
reiceive answers and then parse them and write them
into the file ... OTOH you could simply remove one
of them from the guest :)

HTH,
Herbert

> regards Dani
> 
> ___
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] hostname -va

2006-11-16 Thread Daniel Haensse

> vserver1 != virtual1 ;)
I'm so stupid. I'll repeat this for the rest of the day.

Now it is working. Thank for the quick help.

regards

Dani

___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] hostname -va

2006-11-16 Thread Daniel Hokka Zakrisson

Daniel Haensse wrote:

Dear list,

I have a problem with hostname -va inside of vserver.
Any hints?

best regards

Dani

vserver1.foobar.com
...
192.168.5.101 virtual1.foobar.com  virtual1


vserver1 != virtual1 ;)

--
Daniel Hokka Zakrisson
GPG id: 06723412
GPG fingerprint: A455 4DF3 990A 431F FECA  7947 6136 DDA2 0672 3412
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


Re: [Vserver] hostname -va

2006-11-15 Thread Daniel Haensse

> inside of what vserver :) i.e. please provide
> a few more details, like kernel version, tool version
> and such
>
>   
vserver1:/# uname -va
Linux vserver1.foobar.com 2.6.17-2-vserver-amd64 #1 SMP Wed Sep 13
18:02:36 CEST 2006 x86_64 GNU/Linux
virtual:~# vserver --version
vserver 0.30.211 -- manages the state of vservers
This program is part of util-vserver 0.30.211

It's a debian etch system installed last week, so it should be up to date
> let's see ...
>   
come on :-)
> that one would be quite interesting to get
> the strace from, please try something like
>
>   strace -fF hostname -va
>   
vserver1:/# strace -fF hostname -va
execve("/bin/hostname", ["hostname", "-va"], [/* 15 vars */]) = 0
uname({sys="Linux", node="vserver1.foobar.com", ...}) = 0
brk(0)  = 0x503000
access("/etc/ld.so.nohwcap", F_OK)  = -1 ENOENT (No such file or
directory)
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x2ab393112000
access("/etc/ld.so.preload", R_OK)  = -1 ENOENT (No such file or
directory)
open("/etc/ld.so.cache", O_RDONLY)  = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9416, ...}) = 0
mmap(NULL, 9416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab393114000
close(3)= 0
access("/etc/ld.so.nohwcap", F_OK)  = -1 ENOENT (No such file or
directory)
open("/lib/libc.so.6", O_RDONLY)= 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\305"...,
640) = 640
lseek(3, 624, SEEK_SET) = 624
read(3, "\4\0\0\0\20\0\0\0\1\0\0\0GNU\0\0\0\0\0\2\0\0\0\6\0\0\0"..., 32)
= 32
fstat(3, {st_mode=S_IFREG|0755, st_size=1286312, ...}) = 0
mmap(NULL, 2344904, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x2ab393213000
mprotect(0x2ab393334000, 1161160, PROT_NONE) = 0
mmap(0x2ab393434000, 98304, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x121000) = 0x2ab393434000
mmap(0x2ab39344c000, 14280, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x2ab39344c000
close(3)= 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
= 0x2ab39345
mprotect(0x2ab393434000, 86016, PROT_READ) = 0
arch_prctl(ARCH_SET_FS, 0x2ab3934506d0) = 0
munmap(0x2ab393114000, 9416)= 0
brk(0)  = 0x503000
brk(0x524000)   = 0x524000
uname({sys="Linux", node="vserver1.foobar.com", ...}) = 0
gettimeofday({1163656218, 118761}, NULL) = 0
getpid()= 6611
open("/etc/resolv.conf", O_RDONLY)  = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=125, ...}) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2ab393114000
read(3, "search foobar.com\nnameser"..., 131072) = 125
read(3, "", 131072) = 0
close(3)= 0
munmap(0x2ab393114000, 131072)  = 0
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl(3, F_GETFL)   = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)= 0
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)= 0
socket(PF_FILE, SOCK_STREAM, 0) = 3
fcntl(3, F_GETFL)   = 0x2 (flags O_RDWR)
fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK)= 0
connect(3, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1
ENOENT (No such file or directory)
close(3)= 0
open("/etc/nsswitch.conf", O_RDONLY)= 3
fstat(3, {st_mode=S_IFREG|0644, st_size=475, ...}) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2ab393114000
read(3, "# /etc/nsswitch.conf\n#\n# Example"..., 131072) = 475
read(3, "", 131072) = 0
close(3)= 0
munmap(0x2ab393114000, 131072)  = 0
open("/etc/ld.so.cache", O_RDONLY)  = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9416, ...}) = 0
mmap(NULL, 9416, PROT_READ, MAP_PRIVATE, 3, 0) = 0x2ab393114000
close(3)= 0
access("/etc/ld.so.nohwcap", F_OK)  = -1 ENOENT (No such file or
directory)
open("/lib/libnss_files.so.2", O_RDONLY) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20#\0\0"...,
640) = 640
fstat(3, {st_mode=S_IFREG|0644, st_size=43368, ...}) = 0
mmap(NULL, 1090856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0x2ab393451000
mprotect(0x2ab39345b000, 1049896, PROT_NONE) = 0
mmap(0x2ab39355a000, 8192, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x2ab39355a000
close(3)= 0
munmap(0x2ab393114000, 9416)= 0
open("/etc/host.conf", O_RDONLY)= 3
fstat(3, {st_mode=S_IFREG|0644, st_size=9, ...}) = 0
mmap(NULL, 131072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2ab393114000
read(3, "multi on\n", 131072)   = 9
read(3, "", 131072) =

Re: [Vserver] hostname -va

2006-11-15 Thread Herbert Poetzl
On Wed, Nov 15, 2006 at 06:11:30PM +0100, Daniel Haensse wrote:
> Dear list,
> 
> I have a problem with hostname -va inside of vserver.

inside of what vserver :) i.e. please provide
a few more details, like kernel version, tool version
and such

> Any hints?

let's see ...

> best regards
> 
> Dani
> 
> virtual:~# hostname -va
> virtual
> virtual:~# vserver vserver1 enter
> vserver1:/# hostname -v
> vserver1.foobar.com
> vserver1:/# hostname -va
> hostname: Unknown host

that one would be quite interesting to get
the strace from, please try something like

  strace -fF hostname -va

and provide the output ...

> vserver1:/# cat /etc/hosts
> 192.168.5.101 virtual1.foobar.com  virtual1
> 127.0.0.1 localhost
> 
> # The following lines are desirable for IPv6 capable hosts
> ::1 ip6-localhost ip6-loopback
> fe00::0 ip6-localnet
> ff00::0 ip6-mcastprefix
> ff02::1 ip6-allnodes
> ff02::2 ip6-allrouters
> ff02::3 ip6-allhosts
> 
> vserver1:/# cat /etc/resolv.conf
> search foobar.com
> nameserver 192.168.5.5
> nameserver 129.132.98.12
> nameserver 129.132.250.2
> nameserver 129.132.250.220

IIRC, this won't work as expected, as you can
only specify 3 nameservers in /etc/resolv.conf

TIA,
Herbert

> ___
> Vserver mailing list
> Vserver@list.linux-vserver.org
> http://list.linux-vserver.org/mailman/listinfo/vserver
___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver


[Vserver] hostname -va

2006-11-15 Thread Daniel Haensse
Dear list,

I have a problem with hostname -va inside of vserver.
Any hints?

best regards

Dani

virtual:~# hostname -va
virtual
virtual:~# vserver vserver1 enter
vserver1:/# hostname -v
vserver1.foobar.com
vserver1:/# hostname -va
hostname: Unknown host

vserver1:/# cat /etc/hosts
192.168.5.101 virtual1.foobar.com  virtual1
127.0.0.1 localhost

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

vserver1:/# cat /etc/resolv.conf
search foobar.com
nameserver 192.168.5.5
nameserver 129.132.98.12
nameserver 129.132.250.2
nameserver 129.132.250.220






___
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver