22.3. runlabel を使用した support-tools の実行


組み込みの runlabel を使用して、support-tools コンテナーをデプロイします。この方法は、定義済みコマンドをイメージに直接使用することで、インストール、実行、削除を単純化します。

rhel10/support-tools コンテナーイメージは、support-toolsd デーモンのコンテナー化されたバージョンを実行するために作成されます。support-tools イメージには、installrununinstall という runlabel が含まれています。

前提条件

  • container-tools メタパッケージがインストールされている。

手順

  1. support-tools イメージをプルします。

    # podman pull registry.redhat.io/rhel10/support-tools
  2. support-toolsinstall runlabel を表示します。

    # podman container runlabel install --display rhel10/support-tools
    command: podman run --rm --privileged -v /:/host -e HOST=/host -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools registry.redhat.io/rhel10/support-tools:latest /bin/install.sh

    これは、このコマンドがホストに特権を付与し、コンテナー内の /host にホストの root ファイルシステムをマウントして、install.sh スクリプトを実行することを示しています。

  3. support-toolsinstall runlabel を実行します。

    # podman container runlabel install rhel10/support-tools
    command: podman run --rm --privileged -v /:/host -e HOST=/host -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools registry.redhat.io/rhel10/support-tools:latest /bin/install.sh
    Creating directory at /host//etc/pki/support-tools
    Creating directory at /host//etc/support-tools.d
    Installing file at /host//etc/support-tools.conf
    Installing file at /host//etc/sysconfig/support-tools
    Installing file at /host//etc/logrotate.d/syslog

    これにより、support-tools イメージが後で使用するファイルがホストシステム上に作成されます。

  4. support-toolsrun runlabel を表示します。

    # podman container runlabel run --display rhel10/support-tools
    command: podman run -d --privileged --name support-tools --net=host --pid=host -v /etc/pki/support-tools:/etc/pki/support-tools -v /etc/support-tools.conf:/etc/support-tools.conf -v /etc/sysconfig/support-tools:/etc/sysconfig/support-tools -v /etc/support-tools.d:/etc/support-tools.d -v /var/log:/var/log -v /var/lib/support-tools:/var/lib/support-tools -v /run:/run -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools --restart=always registry.redhat.io/rhel10/support-tools:latest /bin/support-tools.sh

    このコマンドは、ホストに特権を提供し、support-toolsd デーモンを実行するために support-tools コンテナーを起動する際に、ホストから特定のファイルとディレクトリーをコンテナー内にマウントします。

  5. support-toolsrun runlabel を実行します。

    # podman container runlabel run rhel10/support-tools
    command: podman run -d --privileged --name support-tools --net=host --pid=host -v /etc/pki/support-tools:/etc/pki/support-tools -v /etc/support-tools.conf:/etc/support-tools.conf -v /etc/sysconfig/support-tools:/etc/sysconfig/support-tools -v /etc/support-tools.d:/etc/support-tools.d -v /var/log:/var/log -v /var/lib/support-tools:/var/lib/support-tools -v /run:/run -v /etc/machine-id:/etc/machine-id -v /etc/localtime:/etc/localtime -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools --restart=always registry.redhat.io/rhel10/support-tools:latest /bin/support-tools.sh
    28a0d719ff179adcea81eb63cc90fcd09f1755d5edb121399068a4ea59bd0f53

    support-tools コンテナーは権限を開き、ホストから必要なものをマウントし、support-toolsd デーモンをバックグラウンドで実行します (-d)。support-toolsd デーモンはログメッセージの収集を開始し、メッセージを /var/log ディレクトリー内のファイルに送信します。

  6. support-toolsuninstall runlabel を表示します。

    # podman container runlabel uninstall --display rhel10/support-tools
    command: podman run --rm --privileged -v /:/host -e HOST=/host -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools registry.redhat.io/rhel10/support-tools:latest /bin/uninstall.sh
  7. support-toolsuninstall runlabel を実行します。

    # podman container runlabel uninstall rhel10/support-tools
    command: podman run --rm --privileged -v /:/host -e HOST=/host -e IMAGE=registry.redhat.io/rhel10/support-tools:latest -e NAME=support-tools registry.redhat.io/rhel10/support-tools:latest /bin/uninstall.sh
    注記

    この場合、uninstall.sh スクリプトは、/etc/logrotate.d/syslog ファイルを削除します。設定ファイルはクリーンアップされません。

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る