我如何找出本地套接字另一端的程序? [英] how do I find out what program's on the other end of a local socket?

查看:145
本文介绍了我如何找出本地套接字另一端的程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Linux系统上的一个进程,strace告诉我,正在谈论一个具有文件描述符10的套接字。lsof告诉我这是一个带inode 11085的unix套接字,netstat进一步告诉我,inode 11085是一个流套接字,并且它连接。



鉴于此进程没有任何其他线程,因此系统上必须有另一个进程连接到该套接字的另一端。如何查明是什么?



更新:



来自作者的照片这里。实际上,似乎Linux只是不提供这些信息。

解决方案

  ss  - p 

会告诉你。 (假设套接字不是内核本身拥有的。)


A process on my Linux system, strace tells me, is talking on a socket which has file descriptor 10. lsof tells me that this is a unix socket with inode 11085, and netstat further tells me that inode 11085 a stream socket, and that it's connected.

Given that this process doesn't have any other threads, there must therefore be another process on the system that's connected to the other end of this socket. How do I find out what it is?

Update:

There's some illumination from the lsof author here. Essentially, it seems that Linux just doesn't provide this information.

解决方案

ss -p

will tell. (Provided the socket is not owned by the kernel itself.)

这篇关于我如何找出本地套接字另一端的程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆