Show Table of Contents
2.3. 既存の階層へのサブシステムの接続と接続解除
サブシステムを既存の階層に追加するには、既存の階層から接続を解除するか、異なる階層に移動した上で、root として
/etc/cgconfig.conf ファイルの mount セクションを 「階層の作成とサブシステムの接続」 に記載されているのと同じ構文を用いて編集します。cgconfig は、次回の起動時に、指定した階層にしたがってサブシステムを再編成します。
その他の方法
接続されていないサブシステムを既存の階層に追加するには、その階層を再マウントします。
mount コマンドで、追加するサブシステムと remount オプションを指定します。
例2.4 階層の再マウントとサブシステムの追加
lssubsys コマンドは、cpu_and_mem 階層に接続されている cpu、cpuset、および memory のサブシステムを表示します。
~]# lssubsys -am
cpu,cpuset,memory /cgroup/cpu_and_mem
net_cls
ns
cpuacct
devices
freezer
blkioremount オプションを使用して cpu_and_mem 階層を再マウントし、サブシステムの一覧に cpuacct を追加します。
~]# mount -t cgroup -o remount,cpu,cpuset,cpuacct,memory cpu_and_mem /cgroup/cpu_and_memlssubsys コマンドを実行すると、cpuacct が cpu_and_mem 階層に接続されていると表示されるようになりました。
~]# lssubsys -am
cpu,cpuacct,cpuset,memory /cgroup/cpu_and_mem
net_cls
ns
devices
freezer
blkio
また同様に、階層を再マウントしてサブシステム名を -o オプションから削除することで、既存の階層からサブシステムの接続を解除することができます。たとえば、
cpuacct サブシステムの接続を解除するには、単に再マウントして名前を削除します。
~]# mount -t cgroup -o remount,cpu,cpuset,memory cpu_and_mem /cgroup/cpu_and_mem
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.