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 <Eliud.Kyale@windriver.com>
This commit is contained in:
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
SERVICE=
|
SERVICE=
|
||||||
|
|
||||||
|
script_name=$(basename "$0")
|
||||||
|
|
||||||
case $nodetype in
|
case $nodetype in
|
||||||
controller)
|
controller)
|
||||||
SERVICE=controllerconfig.service
|
SERVICE=controllerconfig.service
|
||||||
@@ -26,10 +28,22 @@ case $nodetype in
|
|||||||
esac
|
esac
|
||||||
|
|
||||||
while :; do
|
while :; do
|
||||||
systemctl status $SERVICE |grep -q running
|
status="$(systemctl status ${SERVICE} 2>&1)"
|
||||||
if [ $? -ne 0 ]; then
|
# verify systemctl status response format
|
||||||
exit 0
|
# <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
|
fi
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user