

Docker の `ubuntu:18.04` にインストールした iotop コマンドを実行すると `OSError: Netlink error`
が起きます。どうすれば正常に起動できるでしょうか？

以下エラー全文です。

[code]

    Traceback (most recent call last):
      File "/usr/sbin/iotop", line 17, in <module>
        main()
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 620, in main
        main_loop()
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 610, in <lambda>
        main_loop = lambda: run_iotop(options)
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 508, in run_iotop
        return curses.wrapper(run_iotop_window, options)
      File "/usr/lib/python3.6/curses/__init__.py", line 94, in wrapper
        return func(stdscr, *args, **kwds)
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 498, in run_iotop_window
        taskstats_connection = TaskStatsNetlink(options)
      File "/usr/lib/python3/dist-packages/iotop/data.py", line 137, in __init__
        self.family_id = controller.get_family_id('TASKSTATS')
      File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 69, in get_family_id
        m = GeNlMessage.recv(self.conn)
      File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 51, in recv
        msg = conn.recv()
      File "/usr/lib/python3/dist-packages/iotop/netlink.py", line 229, in recv
        raise err
    OSError: Netlink error: No such file or directory (2)
    
[/code]

再現手順

[code]

    $ docker run -it --rm ubuntu:18.04
    root@618d29523b07:/# apt update
    （省略）
    root@618d29523b07:/# apt install iotop
    （省略）
    root@618d29523b07:/# iotop
    Traceback (most recent call last):
      File "/usr/sbin/iotop", line 17, in <module>
        main()
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 620, in main
        main_loop()
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 610, in <lambda>
        main_loop = lambda: run_iotop(options)
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 508, in run_iotop
        return curses.wrapper(run_iotop_window, options)
      File "/usr/lib/python3.6/curses/__init__.py", line 94, in wrapper
        return func(stdscr, *args, **kwds)
      File "/usr/lib/python3/dist-packages/iotop/ui.py", line 498, in run_iotop_window
        taskstats_connection = TaskStatsNetlink(options)
      File "/usr/lib/python3/dist-packages/iotop/data.py", line 137, in __init__
        self.family_id = controller.get_family_id('TASKSTATS')
      File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 69, in get_family_id
        m = GeNlMessage.recv(self.conn)
      File "/usr/lib/python3/dist-packages/iotop/genetlink.py", line 51, in recv
        msg = conn.recv()
      File "/usr/lib/python3/dist-packages/iotop/netlink.py", line 229, in recv
        raise err
    OSError: Netlink error: No such file or directory (2)
    root@618d29523b07:/#   
    
[/code]

環境

  * `iotop --version`: `iotop 0.6`
  * Docker version 19.03.5, build 633a0ea
  * ホスト環境: macOS Mojave


CC BY-SA 4.0
2020-03-04T02:39:54.493
63547
2020-03-04T02:39:54.493
19110
question
ubuntu docker monitoring
コンテナの中で iotop を実行すると OSError: Netlink error: No such file or director が出る