diff options
Diffstat (limited to 'meta-openstack/recipes-support/deploychef/files/run-postinsts')
| -rw-r--r-- | meta-openstack/recipes-support/deploychef/files/run-postinsts | 38 |
1 files changed, 4 insertions, 34 deletions
diff --git a/meta-openstack/recipes-support/deploychef/files/run-postinsts b/meta-openstack/recipes-support/deploychef/files/run-postinsts index 35d46f0..737012d 100644 --- a/meta-openstack/recipes-support/deploychef/files/run-postinsts +++ b/meta-openstack/recipes-support/deploychef/files/run-postinsts | |||
| @@ -25,40 +25,10 @@ | |||
| 25 | # to run the posinstall script and start the services | 25 | # to run the posinstall script and start the services |
| 26 | # | 26 | # |
| 27 | # | 27 | # |
| 28 | RPM_POSTINSTS_DIR=$1 | 28 | source /opt/deploychef/deploychef-inc |
| 29 | LOG_DIR='/var/log/%PACKAGE_NAME%/' | 29 | #Run postinsts scripts |
| 30 | mkdir -p $LOG_DIR | 30 | execute_all_postinsts |
| 31 | if [ ! -d $RPM_POSTINSTS_DIR ]; then | ||
| 32 | echo "Post Install script dir not set" | ||
| 33 | exit 1 | ||
| 34 | fi | ||
| 35 | cd / #work-around for cinder-volume config file location | ||
| 36 | echo "x$RPM_POSTINSTS_DIR" > "$LOD_DIR"log.run-postinsts | ||
| 37 | for i in `ls $RPM_POSTINSTS_DIR 2> /dev/null`; do | ||
| 38 | i=$RPM_POSTINSTS_DIR$i | ||
| 39 | echo "Running postinst $i..." | ||
| 40 | if [ -f $i ] && $i; then | ||
| 41 | rm $i | ||
| 42 | else | ||
| 43 | echo "ERROR: postinst $i failed. $? " >> "$LOG_DIR"log.run-postinsts | ||
| 44 | fi | ||
| 45 | done | ||
| 46 | |||
| 47 | |||
| 48 | #Start all the modules specified in startup-list | 31 | #Start all the modules specified in startup-list |
| 49 | INITD_DIR=/etc/init.d/ | 32 | start_stop_services 'startup-list' |
| 50 | services=$(cat %DEPLOYCHEF_ROOT_DIR%/startup-list) | ||
| 51 | for service in $services; do | ||
| 52 | service=$(echo $service | awk -F'S..' '{print $2}') | ||
| 53 | if [ -e $INITD_DIR$service ]; then | ||
| 54 | if [ $service = 'cinder-volume' ]; then | ||
| 55 | $INITD_DIR$service reload | ||
| 56 | else | ||
| 57 | $INITD_DIR$service start | ||
| 58 | fi | ||
| 59 | sleep 1 | ||
| 60 | fi | ||
| 61 | done | ||
| 62 | |||
| 63 | #Restart cloud service cloud-init | 33 | #Restart cloud service cloud-init |
| 64 | /etc/init.d/cloud-init start | 34 | /etc/init.d/cloud-init start |
