揮発性のメモ2

http://d.hatena.ne.jp/iww/

netstatでPIDが表示されないとき

# netstat -ntpl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:58634           0.0.0.0:*               LISTEN      -    ★←これ
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      2120/smbd
tcp        0      0 0.0.0.0:44365           0.0.0.0:*               LISTEN      -    ★←これ
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      2304/sshd
tcp        0      0 0.0.0.0:54818           0.0.0.0:*               LISTEN      1675/rpc.statd
#

PIDがハイフンになっている

lsofコマンドを使って調べる

# lsof -i:58634
#

表示されない


/proc/net/tcpを見る

# cat /proc/net/tcp
  sl  local_address rem_address   st tx_queue rx_queue tr tm->when retrnsmt   uid  timeout inode
   0: 00000000:E50A 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 5067 1 ffff88003bb3ee00 100 0 0 10 -1
   1: 00000000:008B 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 5444 1 ffff88003bb3e080 100 0 0 10 -1
   2: 00000000:AD4D 00000000:0000 0A 00000000:00000000 00:00000000 00000000     0        0 5049 1 ffff88003c404040 100 0 0 10 -1

0xE50A は 58634 なので、inodeが5067のがそれっぽい

# lsof | grep 5067
#

出てこない。

こちらを参考に、/procの下を力技でinodeを検索する

# ls -l /proc/[1-9]*/fd/* | grep 5067
#

出てこない。

rcpinfoコマンドを使えば見れるらしい

# rpcinfo -p
   program vers proto   port  service
(中略)
    100021    1   tcp  58634  nlockmgr
    100021    3   tcp  58634  nlockmgr
    100021    4   tcp  58634  nlockmgr

名前が見えなかったのはこれっぽい。
nfs-kernel-server を動かしてたので、カーネル空間のはPIDないし