Files
98b26ab358a852c48ba009bd762543293cb09544
devstack /unstack.sh

116 lines
2.9 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.
#
# Keep track of the current devstack directory.
TOP_DIR=$(cd $(dirname "0ドル") && pwd)
# Import common functions
source $TOP_DIR/functions
# Load local configuration
source $TOP_DIR/stackrc
DATA_DIR=${DATA_DIR:-${DEST}/data}
# Get project function libraries
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/n-vol
# ``os_RELEASE``, ``os_UPDATE``, ``os_PACKAGE``, ``os_CODENAME``
GetOSVersion
if [[ "1ドル" == "--all" ]]; then
UNSTACK_ALL=${UNSTACK_ALL:-1}
fi
# Shut down devstack's screen to get the bulk of OpenStack services in one shot
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
# Swift runs daemons
if is_service_enabled swift; then
# Apache has the WSGI processes
if is_service_enabled horizon; then
stop_service apache2
fi
SCSI_PERSIST_DIR=$NOVA_STATE_PATH/volumes/*
fi
# If tgt driver isn't running this won't work obviously
# So check the response and restart if need be
echo "tgtd seems to be in a bad state, restarting..."
if [[ "$os_PACKAGE" = "deb" ]]; then
restart_service tgt
else
restart_service tgtd
fi
TARGETS=$(sudo tgtadm --op show --mode target)
fi
for i in "${iqn_list[@]}"; do
echo removing iSCSI target: $i
sudo tgt-admin --delete $i
done
fi
if is_service_enabled cinder; then
sudo rm -rf $CINDER_STATE_PATH/volumes/*
fi
if is_service_enabled n-vol; then
sudo rm -rf $NOVA_STATE_PATH/volumes/*
if [[ "$os_PACKAGE" = "deb" ]]; then
stop_service tgt
else
stop_service tgtd
fi
if [[ -n "$UNSTACK_ALL" ]]; then
# Stop MySQL server
if is_service_enabled mysql; then
stop_service mysql
fi
# Stop rabbitmq-server
if is_service_enabled rabbit; then
stop_service rabbitmq-server
fi
# Quantum dhcp agent runs dnsmasq
if is_service_enabled q-dhcp; then
pid=$(ps aux | awk '/[d]nsmasq.+interface=tap/ { print 2ドル }')