Skip to contentSkip to conversation

Cannot ping localhost

DISCUSSION [email protected] 4 participants 6 messages Jul 13, 2007 – Jul 17, 2007

lore
Share & tools
lore
#0 lore raw

Hi:
I am using an OMAP5912 OSK board, and I have build a kernal image and root file system running in it. After booting up, I found that I cannot ping localhost, but my application needs to chect it. The error is as following:

# ping localhost
ping: bad address 'localhost'

my U-Boot is 1.1.5, Linux kernel version 2.6.12-omap1, and BusyBox v1.5.0. I have added /etc/hosts and /etc/host.conf

# cat /etc/hosts
# Do not remove the following line, or various
programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain
localhost

But it doesn't work. Can anybody tell me why?

      ____________________________________________________________________________________

想及時通知通訊錄裡的所有親朋好友好消息,就來 Yahoo!奇摩電子信箱發簡訊!
http://tw.mobile.yahoo.com/texts/mail.php

#1 lore raw

Can you ping 127.0.0.1?

Where is your root file system? Do you have any thing working via Ethernet?

Steve Poulsen

Quoted 33 lines · [email protected] wrote:

Hi:
I am using an OMAP5912 OSK board, and I have build a kernal image and root file system running in it. After booting up, I found that I cannot ping localhost, but my application needs to chect it. The error is as following:

# ping localhost
ping: bad address 'localhost'

my U-Boot is 1.1.5, Linux kernel version 2.6.12-omap1, and BusyBox v1.5.0. I have added /etc/hosts and /etc/host.conf

# cat /etc/hosts
# Do not remove the following line, or various
programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain
localhost

But it doesn't work. Can anybody tell me why?

      ____________________________________________________________________________________

想及時通知通訊錄裡的所有親朋好友好消息,就來 Yahoo!奇摩電子信箱發簡訊!
http://tw.mobile.yahoo.com/texts/mail.php
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

#2 lore raw

Yes, I can, as following:

# ping -c 3 127.0.0.1
PING 127.0.0.1 (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.8 ms
64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.4 ms
64 bytes from 127.0.0.1: seq=2 ttl=64 time=0.4 ms

--- 127.0.0.1 ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.4/0.5/0.8 ms

My root file system is on the ROM 0x1000000

--- Steve Poulsen <[email protected]> 說:

Quoted 17 lines

Can you ping 127.0.0.1?

Where is your root file system? Do you have any
thing working via Ethernet?

Steve Poulsen

Quoted 2 lines · [email protected] wrote:

Hi:
I am using an OMAP5912 OSK board, and I have build

a

Quoted 5 lines

kernal image and root file system running in it.
After booting up, I found that I cannot ping
localhost, but my application needs to chect it.
The error is as following:

Quoted 20 lines
Quoted 4 lines
# ping localhost
ping: bad address 'localhost'

my U-Boot is 1.1.5, Linux kernel version

2.6.12-omap1,

Quoted 14 lines

and BusyBox v1.5.0. I have added /etc/hosts and
/etc/host.conf

# cat /etc/hosts
# Do not remove the following line, or various
programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain
localhost

But it doesn't work. Can anybody tell me why?

____________________________________________________________________________________

Quoted 8 lines
Quoted 1 line

想及時通知通訊錄裡的所有親朋好友好消息,就來

Yahoo!奇摩電子信箱發簡訊!

Quoted 5 lines

http://tw.mobile.yahoo.com/texts/mail.php
_______________________________________________
Linux-omap-open-source mailing list
[email protected]

http://linux.omap.com/mailman/listinfo/linux-omap-open-source

Quoted 4 lines
Quoted 2 lines
      ____________________________________________________________________________________

設定安全圖章,保護您的 Yahoo!奇摩帳號不被駭客盜用!
http://tw.info.yahoo.com/seal/index.html

#3 lore raw
In reply to [email protected]

Hi,

It may be my mail client but it seems that "127.0.0.1" and "localhost" are on different lines in you hosts file.
It needs to be on one line, for example a line in my hosts "127.0.0.1 localhost".

Also, you may want to verify that /etc/nsswitch.conf contains line that has:
"hosts: files" on it.

- Juha

Quoted 34 lines · On 7/12/07, [email protected] <[email protected]> wrote:

Hi:
I am using an OMAP5912 OSK board, and I have build a kernal image and root file system running in it. After booting up, I found that I cannot ping localhost, but my application needs to chect it. The error is as following:

# ping localhost
ping: bad address 'localhost'

my U-Boot is 1.1.5, Linux kernel version 2.6.12-omap1, and BusyBox v1.5.0. I have added /etc/hosts and /etc/host.conf

# cat /etc/hosts
# Do not remove the following line, or various
programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain
localhost

But it doesn't work. Can anybody tell me why?

      ____________________________________________________________________________________

想及時通知通訊錄裡的所有親朋好友好消息,就來 Yahoo!奇摩電子信箱發簡訊!
http://tw.mobile.yahoo.com/texts/mail.php
_______________________________________________
Linux-omap-open-source mailing list
[email protected]
http://linux.omap.com/mailman/listinfo/linux-omap-open-source

Signature · 1 line
Madness takes it's toll. Please have exact change.
#4 lore raw
In reply to [email protected]
Quoted 5 lines · On Fri, 13 Jul 2007, [email protected] wrote:
# ping localhost
ping: bad address 'localhost'

127.0.0.1 localhost.localdomain
localhost

Is that really TWO lines? Or did email program add that newline?

Quoted 1 line

But it doesn't work. Can anybody tell me why?

If I remember correctly there is an option to use builtin hostname resolver in busybox. Are you using it or are you using resolver offered by libc? What libc version you are using? If glibc, are you using dynamic or static nss libraries? If dynamic, do you have libnss_files installed? Is the nsswitch.conf configured correctly?

Signature · 1 line
Arzka
#5 lore raw
Quoted 13 lines · On Fri, 13 Jul 2007, [email protected] wrote:
Quoted 6 lines
# ping localhost
ping: bad address 'localhost'

127.0.0.1 localhost.localdomain
localhost

Is that really TWO lines? Or did email program add that newline?

No, it's the same line.

Quoted 8 lines
Quoted 2 lines

But it doesn't work. Can anybody tell me why?

If I remember correctly there is an option to use builtin hostname
resolver in busybox. Are you using it or are you using resolver offered by
libc? What libc version you are using? If glibc, are

I have tried dnsd of busybox. Do you mean that? I have never found "nameresolver" option of busybox while execuating "make menuconfig".

Quoted 4 lines

you using dynamic or
static nss libraries? If dynamic, do you have
libnss_files installed? Is
the nsswitch.conf configured correctly?

I have tried to build a test program using "getaddrinfo"function, which should be called from glibc. And I printout the return value of the function. The following is the result:

OMAP5912OSK
-2
getaddrinfo() failed: Name or service not known

PS:OMAP5912OSK is the hostname.

My cross compiler is arm-linux-gcc, and the version is 3.3.2. Can anyone tell me how to solve the problem?

Quoted 7 lines
Signature · 5 lines
-- 
Arzka
_______________________________________________
Linux-omap-open-source mailing list
[email protected]

http://linux.omap.com/mailman/listinfo/linux-omap-open-source

Quoted 1 line
      ____________________________________________________________________________________

杜絕網路駭客,保障帳號安全 - 馬上設定 Yahoo!奇摩安全圖章http://tw.info.yahoo.com/seal/index.html