getaddrinfo failed - Name or service not known

Unga unga888 at yahoo.com
Tue Nov 19 17:11:27 UTC 2013





----- Original Message -----
> From: Tom H <tomh0665 at gmail.com>
> To: Ubuntu Users <ubuntu-users at lists.ubuntu.com>
> Cc: 
> Sent: Tuesday, November 19, 2013 3:27 PM
> Subject: Re: getaddrinfo failed - Name or service not known
> 
> On Tue, Nov 19, 2013 at 2:37 PM, Unga <unga888 at yahoo.com> wrote:
> 
> 
>>>  2) When you say "mount the devfs on chroot/dev" do you mean 
> to
>>>  bind-mount "/dev" on "$chroot/dev"?
>> 
>>  cd chroot_dir
>>  mount -o bind /proc proc/
>>  mount -o bind /dev dev/
>>  mount -o bind /sys sys/
> 
> So I don't understand your previous devfs question.
> 

Make file of /dev appear on some other directory is a mount on FreeBSD but on Linux, its a bind. I didn't know that fact earlier.

> 
>>  /usr/sbin/myServer
>> 
>>  The getaddrinfo simply does not work inside the chroot.
> 
> I assume that it works outside the chroot so you could strace and ldd
> it to check that you have the right files and libraries inside the
> chroot.
> 
> Offhand, you might need, file-wise, to add one or more of
> "/etc/{gai,host,nsswitch}.conf" to your previous list of three 
> for
> getaddrinfo to function on Linux; but it's just a guess.
> 
> 
This is a complex server runs only under chroot. When this server runs under root, it automatically switches its user and group and chroot. Therefore, no such thing as running out of chroot as an application.

What I mean is my other applications with getaddrinfo works well as they run without chroot.

Unga





More information about the ubuntu-users mailing list