Localhost not responding

Hi all. Have an Ubuntu install, running Apache, MySQL and Postfix. Basic mail functionality, only sends, no receiving, etc. Today I realized that none of the mail that should have been sent out by various scripts are being sent. Logging into the box, tried telnetting localhost 25, and it just sits and spins. Weird. Try pinging localhost, and again, no response. The mail errors mention that mail being "Deferred: Connection timed out with [127.0.0.1]".

Any ideas on where to look for the issue? My /etc/hosts file contains the following:

127.0.0.1   localhost localhost.localdomain

Checked /etc/network/interfaces and it looks like the loopback is being started with:

auto lo
iface lo inet loopback

Have another tech that was on the server, but no access to him now and trying to figure out what might have come unglued.

Thanks for any help,

Paul

16 Replies

Paul, I don't run Postfix, but my first recommendation would be to check out your Postfix logs. You may need to increase the verbosity of the logging if you can't find what is going on.

If you have a firewall set up, make sure you are allowing traffic on the local interface. My guess is since you can't locally ping 27.0.0.1, it's firewall related.

You might include what version of Ubuntu you are running, along with your Postfix configuration, so others might chime in.

Travis

It's Ubuntu 8.10. I can ping/telnet the server from external, just not from localhost. Is it possible/likely that a firewall would be blocking telnet/ping/any access to localhost but would allow access to these ports from external?

I guess I figured it wasn't a postfix issue, and figured the error postfix is was sending was congruent with the other localhost issues, but can certainly increase logging to see if that yields any more info.

Thanks for the advice,

P

What are the permissions/ownership on /etc? I recently had a very strange issue on one of my servers where hosts right in /etc/hosts were not resolving, turns out an rsync I did to /etc changed the ownership and permissions. Should be root:root, 0755.

Hope that helps!

Permissions look ok, root:root is the owner and attributes look good (rwxr-xr-x). /etc/hosts looks ok as well.

What does

iptables -L

output?

````
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

````

Well it's not your firewall. If I think of anything else I'll post

Is the interface up?

# ifconfig lo

Is your routing table intact?

# route -n

````
ifconfig lo


Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


route -n


174.143.255.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
10.176.64.0 0.0.0.0 255.255.224.0 U 0 0 0 eth1
10.191.192.0 10.176.64.1 255.255.192.0 UG 0 0 0 eth1
10.176.0.0 10.176.64.1 255.248.0.0 UG 0 0 0 eth1
0.0.0.0 174.143.255.1 0.0.0.0 UG 100 0 0 eth0

````

@pmmenneg:

ifconfig lo
          LOOPBACK  MTU:16436  Metric:1

Well, my route -n doesn't show anything for 127.0.0.1 neither… BUT ifconfig should say "UP LOOPBACK RUNNING", so… it's down.

What's in your /etc/network/interfaces, if you have one?

Contents of /etc/network/interfaces

# The loopback network interface
auto lo
iface lo inet loopback

# Load iptables rules
pre-up iptables-restore < /etc/iptables.up.rules

# The primary network interface
# Uncomment this and configure after the system has booted for the first time
auto eth0
iface eth0 inet static
    address 174.143.255.128
    netmask 255.255.255.0
    gateway 174.143.255.1
    dns-nameservers 72.3.128.240 72.3.128.241

auto eth1
iface eth1 inet static
    address 10.176.71.71
    netmask 255.255.224.0

up route add -net 10.176.0.0 netmask 255.248.0.0 gw 10.176.64.1
down route add -net 10.176.0.0 netmask 255.248.0.0 gw 10.176.64.1
up route add -net 10.191.192.0 netmask 255.255.192.0 gw 10.176.64.1
down route add -net 10.191.192.0 netmask 255.255.192.0 gw 10.176.64.1

Loopback is definitely down. Did you try "ifconfig lo up"?

Try commenting out or removing that pre-up line? I wonder if it's being inadvertently associated with loopback and failing somehow.

Tried ifconfig lo up and it seemed to do the trick. Rebooted and all is well… no idea why I wouldn't need to do a ifconfig lo up again, but have checked and the localhost is up… thanks for all the help!

@pmmenneg:

Tried ifconfig lo up and it seemed to do the trick. Rebooted and all is well… no idea why I wouldn't need to do a ifconfig lo up again, but have checked and the localhost is up… thanks for all the help!

Had you rebooted since you started messing with it? Though it sounds ludicrous, the other guy could have done ifconfig lo down

I'd wager there was no iptables-save to restore from at one point, and since the pre-up looks like it might be associated with lo, lo failed to come up. Probably happened a while ago and the OP is just noticing. I think Hoopy spotted it.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct