I am debugging some problems with postfix. When I establish a connection nothing happens and netstat shows:

$ netstat -anp
tcp        0      0       ESTABLISHED -                   

Why is the process missing?

lsof does not show the established connection

$ lsof -n -i :25
master   6139    root   11u  IPv4 472858      0t0  TCP (LISTEN)
master  20033    root   11u  IPv4 523921      0t0  TCP (LISTEN)
smtpd   20042 postfix    6u  IPv4 523921      0t0  TCP (LISTEN)


11:26:44.182443 IP > S 3522488764:3522488764(0) win 65535 <mss 1460,nop,wscale 5,nop,nop,timestamp 73851028 0,sackOK,eol>
11:26:44.182831 IP > S 3950923498:3950923498(0) ack 3522488765 win 5792 <mss 1460,sackOK,timestamp 18832449 73851028,nop,wscale 7>
11:26:44.183150 IP > . ack 1 win 4117 <nop,nop,timestamp 73851029 18832449>

and then nothing more

How do I find out why the listening process is not there? If I attach strace to master nothing is shown. No activity whatsoever during the attempted connection.

  • What exactly is missing in the netstat output? – Volker Siegel Jul 29 '14 at 9:49
  • The PID and process. Something like ESTABLISHED 12775/nscd – Matteo Jul 29 '14 at 10:00
  • These lines just end in ESTABLISHED with my netstat - where did you see that? Which options? – Volker Siegel Jul 29 '14 at 10:03
  • 1
    It's netstat -p what you're looking for?! – Volker Siegel Jul 29 '14 at 10:04
  • You need to show the netstat command you are running, not just the output. – Patrick Jul 29 '14 at 12:49

You need to run netstat using sudo.

Without root privileges, netstat is unable to go poking around in the processes of other users (denoted by a - in the last column of your output), so the -p option will only identify processes owned by you, and this process is apparently not owned by you.

So the solution simply becomes:

sudo netstat -apn
| improve this answer | |
  • 1
    Even when run as root and with -t the process is not shown (just -) – Matteo Jul 29 '14 at 13:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.