
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 <Eliud.Kyale@windriver.com>
50 lines
1.0 KiB
Bash
50 lines
1.0 KiB
Bash
#!/bin/bash
|
|
#
|
|
# Copyright (c) 2016 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
# Wait for base node config service
|
|
. /etc/platform/platform.conf
|
|
|
|
SERVICE=
|
|
|
|
script_name=$(basename "$0")
|
|
|
|
case $nodetype in
|
|
controller)
|
|
SERVICE=controllerconfig.service
|
|
;;
|
|
worker)
|
|
SERVICE=workerconfig.service
|
|
;;
|
|
storage)
|
|
SERVICE=storageconfig.service
|
|
;;
|
|
*)
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
while :; do
|
|
status="$(systemctl status ${SERVICE} 2>&1)"
|
|
# verify systemctl status response format
|
|
# <service> - <Description>
|
|
# ...
|
|
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
|