Rev 1652 | Rev 2002 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
#!/bin/bash# resolve links - $0 may be a softlinkPRG="$0"while [ -h "$PRG" ]; dols=`ls -ld "$PRG"`link=`expr "$ls" : '.*-> \(.*\)$'`if expr "$link" : '/.*' > /dev/null; thenPRG="$link"elsePRG=`dirname "$PRG"`/"$link"fidone# Get standard environment variablesPRGDIR=`dirname $(readlink -f "$PRG")`LOGDIR=${PRGDIR}TOMCAT_HOME="/var/lib/tomcat6"PROJECT_DIR="`dirname ${PRGDIR}`"COMMON_DIR="${PROJECT_DIR}/Common"MAVEN_REPO="${HOME}/.m2/repository"DATE=`date +%Y-%b-%d_%Hh%Mm`LOGERR=error-${DATE}.logtouch ${LOGERR}exec 7>&2 # Link file descriptor #7 with stderr.# Saves stderr.exec 2> ${LOGERR} # stderr replaced with file ${LOGERR}.echo "Starting python services"echo "======================================================================="#start servicesexport PYTHONPATH=$PROJECT_DIR/PyProj/src:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/lib/python2.6:/usr/lib/python2.6/dist-packages:/usr/lib/python2.6/dist-packages/PIL:/usr/lib/python2.6/dist-packages/gst-0.10:/usr/lib/python2.6/dist-packages/gtk-2.0:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/plat-linux2:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/dist-packages/Elixir-0.7.1-py2.6.eggkillall -9 python2.6/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/config/ConfigServer.py -f $COMMON_DIR/src/main/resources/shop2020.cfg >> ${LOGDIR}/config.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/catalog/CatalogServer.py >> ${LOGDIR}/catalog.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/user/UserContextServer.py >> ${LOGDIR}/user.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/order/TransactionServer.py >> ${LOGDIR}/order.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/logistics/service/LogisticsServer.py >> ${LOGDIR}/logistics.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/helpers/impl/HelperServer.py >> ${LOGDIR}/helpers.log 2>&1 &/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/payments/PaymentsServer.py >> ${LOGDIR}/payments.log 2>&1 &/usr/bin/python2.6 -u /root/trunk-chkout/trunk/PyProj/src/shop2020/helpers/impl/EmailSender.py >> ${LOGDIR}/emailsender.log 2>&1 &echo "Started python services"echo "======================================================================="echo "Starting Tomcat"echo "======================================================================="# deploy war and start tomcat/etc/init.d/tomcat6 stoprm -rf ${TOMCAT_HOME}/webapps/ROOT* ${TOMCAT_HOME}/webapps/Support* ${TOMCAT_HOME}/webapps/Social*cp ${MAVEN_REPO}/in/shop2020/Website/1.0-SNAPSHOT/Website-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/ROOT.warcp ${MAVEN_REPO}/in/shop2020/Support/1.0-SNAPSHOT/Support-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/Support.warcp ${MAVEN_REPO}/in/shop2020/Social/1.0-SNAPSHOT/Social-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/Social.war/etc/init.d/tomcat6 startsleep 5echo "Started tomcat"echo "======================================================================="#Clean up IO redirectionexec 2>&7 7>&- # Restore stdout and close file descriptor #7.