Files
e73f88e70b9f547bb8306f1f5715c898426f87b8
devstack /unstack.sh

199 lines
4.1 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
# 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
# ==================
# Plugin Phase 0: override_defaults - allow plugins to override
run_phase override_defaults
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
# --------------
# 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_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
stop_dstat
fi
stop_zookeeper
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
# enabled backends. So if Cinder is enabled, we are sure lvm (lvremove,
# /etc/lvm/lvm.conf, etc.) is here.
if is_service_enabled cinder; then
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
clean_lvm_filter
fi