From 7daf9309e0dd2e2fa4bb88e6c05d7b267dd587b1 Mon Sep 17 00:00:00 2001 From: tamireran Date: Tue, 17 Nov 2015 12:19:47 -0500 Subject: [PATCH] fix upgrade procedure --- src/deploy/NVA_build/upgrade.sh | 14 +++++++++++--- src/deploy/NVA_build/upgrade_wrapper.sh | 4 ++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/deploy/NVA_build/upgrade.sh b/src/deploy/NVA_build/upgrade.sh index adf0f032cc..4a230e58eb 100755 --- a/src/deploy/NVA_build/upgrade.sh +++ b/src/deploy/NVA_build/upgrade.sh @@ -18,12 +18,18 @@ function disable_supervisord { ${SUPERCTL} shutdown #kill services for s in ${services}; do + echo "Kill ${s}" kill -9 ${s} done + local mongostatus=$(ps -ef|grep mongod) + echo "Mongo status after disabling supervisord $mongostatus" + } function enable_supervisord { deploy_log "enable_supervisord" + local mongostatus_bef=$(ps -ef|grep mongod) + echo "Mongo status before starting supervisord $mongostatus_bef" ${SUPERD} } @@ -32,7 +38,7 @@ function restart_webserver { mongodown=true while ${mongodown}; do if netstat -na|grep LISTEN|grep :27017; then - echo here${mongodown} + echo mongo_${mongodown} mongodown=false echo ${mongodown} else @@ -123,7 +129,7 @@ function do_upgrade { sleep 5; restart_s3rver deploy_log "Restarted s3rver" - restart_webserver + restart_webserver deploy_log "Upgrade finished successfully!" } @@ -133,8 +139,10 @@ deploy_log "upgrade.sh called with $@" #on a node cluster they are, which meand the listening ports of the webserver are inherited by this create_multipart_upload. #murder them fds=`lsof -p $$ | grep LISTEN | awk '{print $4}' | sed 's:\(.*\)u:\1:'` +deploy_log "aaa $fds" +echo "File desscriptors $fds" for f in ${fds}; do - exec ${f}<&- + eval "exec ${f}<&-" done if [ "$1" == "from_file" ]; then diff --git a/src/deploy/NVA_build/upgrade_wrapper.sh b/src/deploy/NVA_build/upgrade_wrapper.sh index 7e4bbc7d0e..1aba5debf4 100755 --- a/src/deploy/NVA_build/upgrade_wrapper.sh +++ b/src/deploy/NVA_build/upgrade_wrapper.sh @@ -209,8 +209,8 @@ function post_upgrade { rm -f /tmp/*.tar.gz - /etc/rc.d/init.d/supervisord stop - /etc/rc.d/init.d/supervisord start + #/etc/rc.d/init.d/supervisord stop + #/etc/rc.d/init.d/supervisord start }