rmsock除去不包含文件描述符的套接字。它接受 socket、tcpcb、inpcb、ripcb 或 rawcb 地址并将其转换成套接字地址。然后检查每个进程所有打开的文件以查找套接字的匹配。如果没找到匹配,对该套接字执行异常终止操作,而不考虑套接字 linger 选项的存在。套接字保留的端口号释放。如果发现匹配,文件描述符和主进程状态显示给用户。
命令格式:rmsock Address TypeofAddress
[zwq:/]netstat-Aan|grep6200|grepLISTEN
f1000e0000307bb0 tcp4 0 0 *.6200 *.* LISTEN
--f1000e0000307bb0 为系统内核地址
[zwq:/]rmsock f1000e0000307bb0 tcpcb
The socket 0x307808 is being held by proccess 5701830 (ons).
[zwq:/]ps-ef|grep5701830|grep-vgrep
oracle10 5701830 5112098 0 Apr 21 - 7:17 /oracle10/app/product/crs/10.2.0/opmn/bin/ons-d
f1000e0000307bb0 tcp4 0 0 *.6200 *.* LISTEN
--f1000e0000307bb0 为系统内核地址
[zwq:/]rmsock f1000e0000307bb0 tcpcb
The socket 0x307808 is being held by proccess 5701830 (ons).
[zwq:/]ps-ef|grep5701830|grep-vgrep
oracle10 5701830 5112098 0 Apr 21 - 7:17 /oracle10/app/product/crs/10.2.0/opmn/bin/ons-d
本文介绍了一个用于操作系统中套接字管理的命令——rmsock。该命令可以移除未被文件描述符引用的套接字,并展示了如何使用该命令来定位和解决由特定进程占用的端口问题。

被折叠的 条评论
为什么被折叠?



