Factory/ironic-image/runlogwatch.sh
Steven Hardy 10757d70e3
ironic-image: update to 26.1.2.2
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

(cherry picked from commit b912f9d68a12e40435aae66864c7bc5b39e144207a94581d36b1980eacea368c)
2025-02-13 14:26:37 +00:00

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