Files
404d3afa5c86a99f4c86331c268dab2b2fca7a9f
devstack /unstack.sh

189 lines
3.7 KiB
Bash
Raw Normal View History

# **unstack.sh**
# mysql and rabbit are left running as OpenStack code refreshes
# do not require them to be restarted.
#
while getopts ":a" opt; do
case $opt in
a)
UNSTACK_ALL=""
;;
esac
done
TOP_DIR=$(cd $(dirname "0ドル") && pwd)
# Import common functions
source $TOP_DIR/functions
source $TOP_DIR/lib/database
DATA_DIR=${DATA_DIR:-${DEST}/data}
echo "You are running this script as root."
echo "It might work but you will have a better day running it as $STACK_USER"
exit 1
fi
# Configure Projects
# ==================
source $TOP_DIR/lib/apache
source $TOP_DIR/lib/tls
# Source project function libraries
source $TOP_DIR/lib/infra
source $TOP_DIR/lib/oslo
source $TOP_DIR/lib/glance
source $TOP_DIR/lib/nova
source $TOP_DIR/lib/heat
# --------------
# Phase: source
if [[ -d $TOP_DIR/extras.d ]]; then
for i in $TOP_DIR/extras.d/*.sh; do
[[ -r $i ]] && source $i source
done
fi
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
GetOSVersion
# ==========
source $TOP_DIR/openrc
if is_service_enabled heat; then
stop_heat
stop_ceilometer
fi
if is_service_enabled nova; then
stop_nova
fi
fi
# Apache has the WSGI processes
if is_service_enabled horizon; then
cleanup_CA
cleanup_CA
fi
# perfect, we should clean up cinder stop paths.
cleanup_cinder || /bin/true
if [[ -n "$UNSTACK_ALL" ]]; then
# Stop MySQL server
if is_service_enabled mysql; then
stop_service mysql
fi
stop_service postgresql
fi
if is_service_enabled rabbit; then
stop_service rabbitmq-server
fi
stop_neutron
stop_neutron_third_party
cleanup_neutron
cleanup_trove
fi
SCREEN=$(which screen)
if [[ -n "$SCREEN" ]]; then
SESSION=$(screen -ls | awk '/[0-9].stack/ { print 1ドル }')
if [[ -n "$SESSION" ]]; then
screen -X -S $SESSION quit
fi
fi
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true