From 8fcb5aec9aeeffb2d6878b49e58288cc925ac65a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 4 Sep 2026 08:39:05 -0400 Subject: [PATCH] Avoid exiting on tail failure tail can fail in certain scenarios. Switch to wait if that should occur. --- .../el8/profiles/default/scripts/firstboot.sh | 5 ++++- .../el9-diskless/profiles/default/scripts/firstboot.sh | 7 ++++++- .../ubuntu20.04/profiles/default/scripts/firstboot.sh | 5 ++++- .../ubuntu20.04/profiles/default/scripts/post.sh | 5 ++++- .../ubuntu20.04/profiles/default/scripts/pre.sh | 5 ++++- .../ubuntu22.04/profiles/default/scripts/firstboot.sh | 5 ++++- .../ubuntu22.04/profiles/default/scripts/post.sh | 5 ++++- .../ubuntu22.04/profiles/default/scripts/pre.sh | 5 ++++- 8 files changed, 34 insertions(+), 8 deletions(-) diff --git a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh index cfa94615..cf1da0fd 100644 --- a/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el8/profiles/default/scripts/firstboot.sh @@ -69,4 +69,7 @@ systemctl disable firstboot rm /etc/systemd/system/firstboot.service rm /etc/confluent/firstboot.ran ) & -tail --pid $! -n 0 -F /var/log/confluent/confluent-firstboot.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /var/log/confluent/confluent-firstboot.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/el9-diskless/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/el9-diskless/profiles/default/scripts/firstboot.sh index 6a1c98b4..2c5bcfd3 100644 --- a/confluent_osdeploy/el9-diskless/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/el9-diskless/profiles/default/scripts/firstboot.sh @@ -48,4 +48,9 @@ systemctl disable firstboot rm /etc/systemd/system/firstboot.service rm /etc/confluent/firstboot.ran ) & -tail --pid $! -F /var/log/confluent/confluent-firstboot.log > /dev/console +subpid=$! +if ! tail --pid $subpid -F /var/log/confluent/confluent-firstboot.log > /dev/console; +then + wait $subpid +fi + diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/firstboot.sh index e45f876f..b142e76c 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/firstboot.sh @@ -27,4 +27,7 @@ run_remote_parts firstboot.d run_remote_config firstboot.d curl --capath /etc/confluent/tls -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" -X POST -d "status: complete" https://$confluent_mgr/confluent-api/self/updatestatus ) & -tail --pid $! -n 0 -F /target/var/log/confluent/confluent-post.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /target/var/log/confluent/confluent-firstboot.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh index d9730889..38f0b40d 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/post.sh @@ -92,4 +92,7 @@ python3 /opt/confluent/bin/apiclient /confluent-api/self/updatestatus -d 'statu umount /target/sys /target/dev /target/proc ) & -tail --pid $! -n 0 -F /target/var/log/confluent/confluent-post.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /target/var/log/confluent/confluent-post.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/pre.sh b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/pre.sh index 745f3590..b74e9e51 100755 --- a/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/ubuntu20.04/profiles/default/scripts/pre.sh @@ -46,5 +46,8 @@ if [ ! -e /tmp/installdisk ]; then fi sed -i s!%%INSTALLDISK%%!/dev/$(cat /tmp/installdisk)! /autoinstall.yaml ) & -tail --pid $! -n 0 -F /var/log/confluent/confluent-pre.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /var/log/confluent/confluent-pre.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/firstboot.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/firstboot.sh index dc8bbb0c..f74046d8 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/firstboot.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/firstboot.sh @@ -40,4 +40,7 @@ run_remote_parts firstboot.d run_remote_config firstboot.d curl --capath /etc/confluent/tls -f -H "CONFLUENT_NODENAME: $nodename" -H "CONFLUENT_APIKEY: $confluent_apikey" -X POST -d "status: complete" https://$confluent_mgr/confluent-api/self/updatestatus ) & -tail --pid $! -n 0 -F /var/log/confluent/confluent-post.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /var/log/confluent/confluent-firstboot.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh index 14b0e6a4..0dab9f93 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/post.sh @@ -125,4 +125,7 @@ python3 /opt/confluent/bin/apiclient /confluent-api/self/updatestatus -d 'statu umount /target/sys /target/dev /target/proc /target/run ) & -tail --pid $! -n 0 -F /target/var/log/confluent/confluent-post.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /target/var/log/confluent/confluent-post.log > /dev/console; then + wait $subpid +fi diff --git a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/pre.sh b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/pre.sh index 5a863f9f..e2a6eabd 100755 --- a/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/pre.sh +++ b/confluent_osdeploy/ubuntu22.04/profiles/default/scripts/pre.sh @@ -59,5 +59,8 @@ if [ "$cryptboot" != "" ] && [ "$cryptboot" != "none" ] && [ "$cryptboot" != "n chmod 000 /etc/confluent_lukspass fi ) & -tail --pid $! -n 0 -F /var/log/confluent/confluent-pre.log > /dev/console +subpid=$! +if ! tail --pid $subpid -n 0 -F /var/log/confluent/confluent-pre.log > /dev/console; then + wait $subpid +fi