From 2542d14aeaaf72215f78476a69899b93ed7db9b0 Mon Sep 17 00:00:00 2001 From: "Kyale, Eliud" Date: Fri, 5 Sep 2025 15:26:04 -0400 Subject: [PATCH] Update config-gate systemd service Add error handling to wait_for_config_init.sh Handling the following error: 2025-09-02T07:03:32.706 controller-0 \ wait_for_config_init.sh[22308]: info \ Failed to get properties: Message recipient \ disconnected from message bus without replying 2025-09-02T07:03:32.707 controller-0 systemd[1]: \ info Finished General StarlingX config gate. Test plan: PASS - AIO-SX: iso install + config PASS - AIO-DX: iso install + config PASS - Standard with worker and storage node install + config PASS - DC system controller: iso install + config Closes-Bug: 2122164 Change-Id: Ic05b1f6805b1a798343b48238339056d0c95effe Signed-off-by: Kyale, Eliud --- config-gate/files/wait_for_config_init.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/config-gate/files/wait_for_config_init.sh b/config-gate/files/wait_for_config_init.sh index 670ec99b85..da19595b75 100644 --- a/config-gate/files/wait_for_config_init.sh +++ b/config-gate/files/wait_for_config_init.sh @@ -10,6 +10,8 @@ SERVICE= +script_name=$(basename "$0") + case $nodetype in controller) SERVICE=controllerconfig.service @@ -26,10 +28,22 @@ case $nodetype in esac while :; do - systemctl status $SERVICE |grep -q running - if [ $? -ne 0 ]; then - exit 0 + status="$(systemctl status ${SERVICE} 2>&1)" + # verify systemctl status response format + # - + # ... + if echo "${status}" | grep -q "${SERVICE}" + then + if ! echo "${status}" | grep -q running + then + msg="${SERVICE} has finished running." + logger -t "${script_name}" "${msg}" + echo "${script_name} - ${msg}" + exit 0 + fi + else + logger -t "${script_name}" "${status}" + echo "${script_name} - ${status}" fi sleep 1 done -