奇妙なマウントアイテム、インターネット上のprocfs:

奇妙なマウントアイテム、インターネット上のprocfs:

デバイスに次の奇妙な項目が表示されますmount

none on net:[4026532603] type proc (rw,relatime)
none on net:[4026532424] type proc (rw,relatime)

これが何なのか、なぜそうなのかご存知ですか? procf が /proc 以外の他の用途で使われるのを見たのは今回が初めてです。この「net:」とは何ですか?コンセントやパイプのようなものですか?

私はある種のBusyBoxベースのLinuxを使用する組み込みデバイスで3.8 rtカーネルを実行しています。

おそらく関連項目は次のとおりです/proc/mounts

rootfs / rootfs rw 0 0
none /proc proc rw,relatime 0 0
none net:[4026532603] proc rw,relatime 0 0
none net:[4026532424] proc rw,relatime 0 0
mgmt /sys sysfs rw,relatime 0 0

修正する:

@VenkatCの答えのおかげで、次の出力で確認されたように名前空間に関連していることがわかりました。

$ ls -l /proc/$$/ns
total 0
lrwxrwxrwx 1 root root 0 Nov  3 18:59 ipc -> ipc:[4026531839]
lrwxrwxrwx 1 root root 0 Nov  3 18:59 mnt -> mnt:[4026532733]
lrwxrwxrwx 1 root root 0 Nov  3 18:59 net -> net:[4026532603]
lrwxrwxrwx 1 root root 0 Nov  3 18:59 pid -> pid:[4026531836]
lrwxrwxrwx 1 root root 0 Nov  3 18:59 uts -> uts:[4026531838]

ベストアンサー1

これらのエントリはネットワークネームスペースに関連しています。 man 名前空間で(7)

   The /proc/[pid]/ns/ directory
       Each process has a /proc/[pid]/ns/ subdirectory containing one entry
       for each namespace that supports being manipulated by setns(2):
       $ ls -l /proc/$$/ns
       total 0
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 ipc -> ipc:[4026531839]
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 mnt -> mnt:[4026531840]
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 net -> net:[4026531956]
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 pid -> pid:[4026531836]
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 user -> user:[4026531837]
       lrwxrwxrwx. 1 mtk mtk 0 Jan 14 01:20 uts -> uts:[4026531838]

ご覧のとおり順より高いエントリはネットワークネームスペースを参照します。問題のデバイスが複数の名前空間を使用して異なるプロセスを実行している可能性があることを理解してください。

テスト名前空間を作成し、/proc/mountsで同様のマウントを見ることができました。

[cv@cent2 ~]$ ip netns list
netns1
[cv@cent2 ~]$ grep net: /proc/mounts
proc net:[4026532238] proc rw,nosuid,nodev,noexec,relatime 0 0
proc net:[4026532238] proc rw,nosuid,nodev,noexec,relatime 0 0

おすすめ記事