Align with: https://build.opensuse.org/package/rdiff/isv:SUSE:Edge:Metal3:Ironic:2024.2/ironic-image?linkrev=base&rev=10 https://github.com/suse-edge/charts/pull/182 Fixes a pod restart caused by the runlogwatch.sh script
20 lines
579 B
Bash
20 lines
579 B
Bash
#!/usr/bin/bash
|
|
|
|
# Ramdisk logs path
|
|
LOG_DIR="/shared/log/ironic/deploy"
|
|
|
|
# The ironic container creates the directory, wait for
|
|
# it to exist before running inotifywait or it can fail causing
|
|
# a spurious restart
|
|
while [ ! -d "${LOG_DIR}" ]; do
|
|
echo "Waiting for ${LOG_DIR}"
|
|
sleep 5
|
|
done
|
|
|
|
inotifywait -m "${LOG_DIR}" -e close_write |
|
|
while read -r path _action file; do
|
|
echo "************ Contents of ${path}/${file} ramdisk log file bundle **************"
|
|
tar -xOzvvf "${path}/${file}" | sed -e "s/^/${file}: /"
|
|
rm -f "${path}/${file}"
|
|
done
|