2024-10-21 15:18:05 +03:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
# Ramdisk logs path
|
2024-11-12 18:44:52 +00:00
|
|
|
LOG_DIR="/shared/log/ironic/deploy"
|
2024-10-21 15:18:05 +03:00
|
|
|
|
2025-02-12 09:06:45 +00:00
|
|
|
# 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
|
|
|
|
|
2024-11-12 18:44:52 +00:00
|
|
|
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}"
|
2024-10-21 15:18:05 +03:00
|
|
|
done
|