Run support-tools with runlabels

Deploy the support-tools container by using its built-in runlabels. This method simplifies installation, execution, and removal by using the commands defined directly in the image.

Before you begin

  • The container-tools meta-package is installed.

About this task

The rhel10/support-tools container image is made to run a containerized version of the support-toolsd daemon. The support-tools image contains the following runlabels: install, run and uninstall.

Procedure

  1. Pull the support-tools image:
    # podman pull registry.redhat.io/rhel10/support-tools
  2. Display the install runlabel for support-tools:
    # 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

    This shows that the command grants the host privileges, mounts the host’s root filesystem at /host in the container, and runs an install.sh script.

  3. Run the install runlabel for support-tools:
    # 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

    This creates files on the host system that the support-tools image will use later.

  4. Display the run runlabel for support-tools:
    # 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

    The command provides privileges to the host and mounts specific files and directories from the host inside the container when it launches the support-tools container to run the support-toolsd daemon.

  5. Run the run runlabel for support-tools:
    # 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

    The support-tools container opens privileges, mounts what it needs from the host, and runs the support-toolsd daemon in the background (-d). The support-toolsd daemon begins gathering log messages and directing messages to files in the /var/log directory.

  6. Display the uninstall runlabel for support-tools:
    # 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. Run the uninstall runlabel for support-tools:
    # 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
    Note

    In this case, the uninstall.sh script just removes the /etc/logrotate.d/syslog file. It does not clean up the configuration files.