update/patch-scripts/EXAMPLE_DC/scripts/distcloud-restart-example
albailey 73c948f9e3 Add an example restart script for distributed cloud
This is the type of script that can be invoked when
applying designer patches to test distributed cloud changes.

Change-Id: I3c743bf550e28f54f5dd4b1100ef561573e88e1a
Story: 2008137
Task: 41178
Signed-off-by: albailey <Al.Bailey@windriver.com>
2020-11-02 16:25:57 -06:00

49 lines
1.1 KiB
Bash

#!/bin/bash
#
# Copyright (c) 2020 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
#
# This script provides an example in-service distcloud restart
#
#
# The patching subsystem provides a patch-functions bash source file
# with useful function and variable definitions.
#
. /etc/patching/patch-functions
#
# We can now check to see what type of node we're on, if it's locked, etc,
# and act accordingly
#
#
# Declare an overall script return code
#
declare -i GLOBAL_RC=$PATCH_STATUS_OK
if is_controller
then
processes_to_restart="dcmanager-manager dcmanager-api \
dcmanager-audit dcmanager-orchestrator \
dcorch-engine dcorch-sysinv-api-proxy dcdbsync-api \
dcorch-patch-api-proxy dcorch-identity-api-proxy"
/usr/local/sbin/patch-restart-processes ${processes_to_restart}
if [ $? != 0 ] ; then
loginfo "patching restart failed"
loginfo "... process-restart ${processes_to_restart}"
exit ${PATCH_STATUS_FAILED}
fi
fi
# Nothing to restart on workers or storage
#
# Exit the script with the overall return code
#
exit $GLOBAL_RC