20.3. Running support-tools with runlabels
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. The following procedure steps you through installing, running, and uninstalling the support-tools image:
Prerequisites
-
The
container-toolsmeta-package is installed.
Procedure
Pull the
support-toolsimage:# podman pull registry.redhat.io/rhel10/support-toolsDisplay the
installrunlabel forsupport-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.shThis shows that the command will open privileges to the host, mount the host root filesystem on
/hostin the container, and run aninstall.shscript.Run the
installrunlabel forsupport-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/syslogThis creates files on the host system that the
support-toolsimage will use later.Display the
runrunlabel forsupport-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.shThis shows that the command opens privileges to the host and mount specific files and directories from the host inside the container, when it launches the
support-toolscontainer to run thesupport-toolsddaemon.Execute the
runrunlabel forsupport-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 28a0d719ff179adcea81eb63cc90fcd09f1755d5edb121399068a4ea59bd0f53The
support-toolscontainer opens privileges, mounts what it needs from the host, and runs thesupport-toolsddaemon in the background (-d). Thesupport-toolsddaemon begins gathering log messages and directing messages to files in the/var/logdirectory.Display the
uninstallrunlabel forsupport-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.shRun the
uninstallrunlabel forsupport-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
In this case, the uninstall.sh script just removes the /etc/logrotate.d/syslog file. It does not clean up the configuration files.