summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/deploychef/files/service-shutdown
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/files/service-shutdown')
-rw-r--r--meta-openstack/recipes-support/deploychef/files/service-shutdown39
1 files changed, 13 insertions, 26 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/service-shutdown b/meta-openstack/recipes-support/deploychef/files/service-shutdown
index b89f9fa..00b571f 100644
--- a/meta-openstack/recipes-support/deploychef/files/service-shutdown
+++ b/meta-openstack/recipes-support/deploychef/files/service-shutdown
@@ -22,33 +22,20 @@
22# THE SOFTWARE. 22# THE SOFTWARE.
23# 23#
24# 24#
25INITD_DIR=/etc/init.d/ 25source /opt/deploychef/deploychef-inc
26services=$(cat %DEPLOYCHEF_ROOT_DIR%/shutdown-list)
27for service in $services; do
28 service=$(echo $service | awk -F'K..' '{print $2}')
29 if [ -e $INITD_DIR$service ]; then
30 $INITD_DIR$service stop
31 sleep 1
32 fi
33done
34 26
27make_log_dir
28start_stop_services 'shutdown-list'
35#Clean up swift installation and all stale files 29#Clean up swift installation and all stale files
36/etc/swift/swift_setup.sh clean 30if [ -f /etc/swift/swift_setup.sh ]; then
37 31 /etc/swift/swift_setup.sh clean
38#Delete all the know data base entries 32fi
39databases="ceilometer cinder glance heat keystone nova ovs_neutron \ 33#Now stop postgresql and delete database directory
40 postgres" 34if [ -e ${INITD_DIR}/postgresql ]; then
41for database in $databases; do 35 ${INITD_DIR}/postgresql stop
42 sudo -u postgres dropdb $database 36 killall postgres &
43 sleep 1 37 wait
44done 38 rm -rf /etc/postgresql &
45 39 wait
46#Now shutdown postgres and database directory
47if [ -e ${INITD_DIR}postgresql ]; then
48 ${INITD_DIR}postgresql stop
49 killall postgres
50 sleep 1
51 rm -rf /etc/postgresql
52 sleep 1
53fi 40fi
54 41