ip netns add test後に名前空間を削除できない問題をデバッグする方法[閉じる]

ip netns add test後に名前空間を削除できない問題をデバッグする方法[閉じる]
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpu,cpuacct)
cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,pids)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=34,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=9430)
mqueue on /dev/mqueue type mqueue (rw,relatime)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
tmpfs on /run/user/0 type tmpfs (rw,nosuid,nodev,relatime,size=401072k,mode=700)
tmpfs on /run/netns type tmpfs (rw,nosuid,noexec,relatime,size=401076k,mode=755)
nsfs on /run/netns/test type nsfs (rw)


root@localhost:~# ip netns delete test
Cannot remove namespace file "/var/run/netns/test": Device or resource busy
root@localhost:~# umount --force /run/netns/test 
umount: /run/netns/test: not mounted


netns       20            root  cwd       DIR               8,17     4096          2 /
netns       20            root  rtd       DIR               8,17     4096          2 /
netns       20            root  txt   unknown                                        /proc/20/exe


root        20  0.0  0.0      0     0 ?        S<   06:11   0:00 [netns]
root        21  0.0  0.0      0     0 ?        S    06:11   0:00 [khungtaskd]

この問題を解決するにはどうすればよいですか?netnsこのマウントポイントの唯一のユーザーだと思いますか?スレッドを終了する必要がありますか?それとも終了できますか?

ベストアンサー1

名前空間を使用するプロセスを確認してください。fuser

fuser /var/run/netns/test

リソースを使用するプロセスIDを示す数値一覧が出力されます。その後、以下を使用して各プロセスIDを確認できますps

ps -p 123

おすすめ記事