ha/service-mgmt/sm-1.0.0/scripts/sm.shutdown

41 lines
683 B
Bash

#! /bin/sh
#
# Copyright (c) 2014-2017 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
case "$1" in
start)
;;
stop)
. /etc/platform/platform.conf
if [[ "$subfunction" == "controller,worker"* ]]; then
# Trigger logout of iSCSI connections to avoid shutdown race condition
/sbin/iscsiadm -m node --logoutall=all
fi
touch /var/run/.sm_node_unhealthy
date >> /var/log/sm-shutdown.log
echo "Shutdown SM." >> /var/log/sm-shutdown.log
sleep 5
;;
status)
;;
restart)
;;
reload)
;;
force-reload)
;;
*)
esac