52 lines
908 B
Bash
52 lines
908 B
Bash
#! /bin/sh
|
|
#
|
|
# Copyright (c) 2014-2017 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
# Description: sm.shutdown
|
|
#
|
|
# Short-Description: Service Management Engine Shutdowm.
|
|
# Provides: sm.shutdown
|
|
# Required-Start:
|
|
# Required-Stop:
|
|
# Default-Start: 3 5
|
|
# Default-Stop: 0 6
|
|
### END INIT INFO
|
|
|
|
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
|
|
|