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-toolsmeta-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
-
Pull the
support-toolsimage:# podman pull registry.redhat.io/rhel10/support-tools -
Display the
installrunlabel forsupport-tools:# podman container runlabel install --display rhel10/support-toolscommand: 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 grants the host privileges, mounts the host’s root filesystem at
/hostin the container, and runs aninstall.shscript. -
Run the
installrunlabel forsupport-tools:# podman container runlabel install rhel10/support-toolscommand: 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-toolscommand: 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.shThe command provides privileges to the host and mounts specific files and directories from the host inside the container when it launches the
support-toolscontainer to run thesupport-toolsddaemon. -
Run the
runrunlabel forsupport-tools:# podman container runlabel run rhel10/support-toolscommand: 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-toolscommand: 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 -
Run the
uninstallrunlabel forsupport-tools:# podman container runlabel uninstall rhel10/support-toolscommand: 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.shNote In this case, the
uninstall.shscript just removes the/etc/logrotate.d/syslogfile. It does not clean up the configuration files.