From e376e96fb53565221bccb97dca50887a08777394 Mon Sep 17 00:00:00 2001 From: Lin Liu Date: Mon, 4 Nov 2024 09:36:31 +0000 Subject: [PATCH] CA-401404: Only check previous active service status `systemctl list-dependencies --plain --no-pager` list uncessary xapi-clusterd service when xapi-clusterd-shutdown is started. Here instead of checking the status of all dependencies, we only check the status of previous enabled dependencies. This also complies with the behavior before toolstack.target Signed-off-by: Lin Liu --- scripts/xe-toolstack-restart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/xe-toolstack-restart b/scripts/xe-toolstack-restart index d377ae7acb..55e82e8f3d 100755 --- a/scripts/xe-toolstack-restart +++ b/scripts/xe-toolstack-restart @@ -43,7 +43,11 @@ set -e systemctl restart $MPATHALERT toolstack.target # Check the status of toolstack services -for service in $(systemctl list-dependencies --plain --no-pager toolstack.target); do +for service in $(systemctl list-dependencies --plain --no-pager toolstack.target) $MPATHALERT; do + + # Skip check if the service is not enabled + systemctl is-enabled "$service" >/dev/null 2>&1 || continue + # During system bootup, xcp-rrdd-dcmi.service often fail as # `ipmitool dcmi discover` discover nothing, just ignore it for now if [ "$service" == "xcp-rrdd-dcmi.service" ]; then