diff options
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/files/service-shutdown')
| -rw-r--r-- | meta-openstack/recipes-support/deploychef/files/service-shutdown | 39 |
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 | # |
| 25 | INITD_DIR=/etc/init.d/ | 25 | source /opt/deploychef/deploychef-inc |
| 26 | services=$(cat %DEPLOYCHEF_ROOT_DIR%/shutdown-list) | ||
| 27 | for 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 | ||
| 33 | done | ||
| 34 | 26 | ||
| 27 | make_log_dir | ||
| 28 | start_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 | 30 | if [ -f /etc/swift/swift_setup.sh ]; then |
| 37 | 31 | /etc/swift/swift_setup.sh clean | |
| 38 | #Delete all the know data base entries | 32 | fi |
| 39 | databases="ceilometer cinder glance heat keystone nova ovs_neutron \ | 33 | #Now stop postgresql and delete database directory |
| 40 | postgres" | 34 | if [ -e ${INITD_DIR}/postgresql ]; then |
| 41 | for database in $databases; do | 35 | ${INITD_DIR}/postgresql stop |
| 42 | sudo -u postgres dropdb $database | 36 | killall postgres & |
| 43 | sleep 1 | 37 | wait |
| 44 | done | 38 | rm -rf /etc/postgresql & |
| 45 | 39 | wait | |
| 46 | #Now shutdown postgres and database directory | ||
| 47 | if [ -e ${INITD_DIR}postgresql ]; then | ||
| 48 | ${INITD_DIR}postgresql stop | ||
| 49 | killall postgres | ||
| 50 | sleep 1 | ||
| 51 | rm -rf /etc/postgresql | ||
| 52 | sleep 1 | ||
| 53 | fi | 40 | fi |
| 54 | 41 | ||
