summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/deploychef/files/service-shutdown
diff options
context:
space:
mode:
authorMustapha Lansana <Mustapha.Lansana@windriver.com>2014-05-27 22:02:57 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-09-26 09:09:21 -0400
commit800f64a64014fdbe046a6d0969303057de2e6539 (patch)
treed3564354420428bf294260e11597c0080b60831b /meta-openstack/recipes-support/deploychef/files/service-shutdown
parenteeda01a7be07c78dac7b6ae5013524d857ceba3b (diff)
downloadmeta-cloud-services-800f64a64014fdbe046a6d0969303057de2e6539.tar.gz
deploychef: helper script and configuration files
Deploychef package reconfigures an openstack installation. These are helper files used by the deploychef package to bring the system down and back up again before, and after chef-solo has generated our desired configuration files from template files. Later on in this commit series, the *-list files will be replaced with dynamically generated *-list files by openstackchef. In addition, the script files will be adapted to support openstackchef. Signed-off-by: Mustapha Lansana <Mustapha.Lansana@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/files/service-shutdown')
-rw-r--r--meta-openstack/recipes-support/deploychef/files/service-shutdown54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/service-shutdown b/meta-openstack/recipes-support/deploychef/files/service-shutdown
new file mode 100644
index 0000000..b89f9fa
--- /dev/null
+++ b/meta-openstack/recipes-support/deploychef/files/service-shutdown
@@ -0,0 +1,54 @@
1#!/bin/bash
2# service-shutdown
3#
4# Copyright (c) 2014 Wind River Systems, Inc.
5#
6# Permission is hereby granted, free of charge, to any person obtaining a copy
7# of this software and associated documentation files (the "Software"), to deal
8# in the Software without restriction, including without limitation the rights
9# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10# copies of the Software, and to permit persons to whom the Software is
11# furnished to do so, subject to the following conditions:
12#
13# The above copyright notice and this permission notice shall be included in
14# all copies or substantial portions of the Software.
15
16# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22# THE SOFTWARE.
23#
24#
25INITD_DIR=/etc/init.d/
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
35#Clean up swift installation and all stale files
36/etc/swift/swift_setup.sh clean
37
38#Delete all the know data base entries
39databases="ceilometer cinder glance heat keystone nova ovs_neutron \
40 postgres"
41for database in $databases; do
42 sudo -u postgres dropdb $database
43 sleep 1
44done
45
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
54