免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1716 | 回复: 5
打印 上一主题 下一主题

晕,lsof失效了,咋回事? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-09-27 11:15 |只看该作者 |倒序浏览
bash-2.05b# netstat -a|grep 8009
      *.18009              *.*                0      0 49152      0 LISTEN
      *.8009               *.*                0      0 49152      0 LISTEN
bash-2.05b#
bash-2.05b# lsof -i TCP:8009
bash-2.05b#
bash-2.05b# lsof -i |grep 8009
bash-2.05b# lsof -i -n|grep 8009


咋回事呢?

只能通过pfile去找端口被哪个进程占用着了

论坛徽章:
0
2 [报告]
发表于 2009-09-27 11:18 |只看该作者
原来如此


There were two explanations why “lsof” did not show, what was expected:

1) One thing that might prevent lsof to print all, is if the ports are controlled by inetd
or some such (i.e. there is nothing actively listening on them until you try talking to them).

Also, try telneting to the port and then run lsof while the telnet session is connected.

2) On Solaris 10, using “lsof -i” to show mapping of processes to TCP ports incorrectly shows all
processes that have socket open as using port 65535, for example:

sshd 8005 root 8u IPv4 0×60007ebdac0 0t0 TCP *:65535
(LISTEN)
sendmail 1116 root 5u IPv4 0×60007ecce00 0t0 TCP *:65535
(LISTEN)

This is a known bug in lsof that can _not_ be fixed because of differences between Solaris 10
and previous versions. So the useful “lsof -i :<port>” is now not useful.

论坛徽章:
0
3 [报告]
发表于 2009-09-27 11:59 |只看该作者
pfiles命令也可以达到同样的效果。

solaris 8已经有了。虽然没有lsof方便。

论坛徽章:
0
4 [报告]
发表于 2009-09-28 10:55 |只看该作者
pfiles也可以查看进程打开的文件的的

论坛徽章:
0
5 [报告]
发表于 2009-09-28 15:29 |只看该作者
原帖由 guopy007 于 2009-9-28 10:55 发表
pfiles也可以查看进程打开的文件的的


稍微有点麻烦

论坛徽章:
0
6 [报告]
发表于 2009-09-29 14:08 |只看该作者
原帖由 yuio654 于 2009-9-27 11:18 发表
原来如此


There were two explanations why “lsof” did not show, what was expected:

1) One thing that might prevent lsof to print all, is if the ports are controlled by inetd
or some such ...


这个收藏了
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP