Subversion Repositories SmartDukaan

Rev

Rev 1989 | Rev 2713 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1652 rajveer 1
#!/bin/bash
2
 
3
# resolve links - $0 may be a softlink
4
PRG="$0"
5
 
6
while [ -h "$PRG" ]; do
7
  ls=`ls -ld "$PRG"`
8
  link=`expr "$ls" : '.*-> \(.*\)$'`
9
  if expr "$link" : '/.*' > /dev/null; then
10
    PRG="$link"
11
  else
12
    PRG=`dirname "$PRG"`/"$link"
13
  fi
14
done
15
 
16
# Get standard environment variables
17
PRGDIR=`dirname $(readlink -f "$PRG")`
18
 
19
LOGDIR=${PRGDIR}
20
TOMCAT_HOME="/var/lib/tomcat6"
21
PROJECT_DIR="`dirname ${PRGDIR}`"
22
COMMON_DIR="${PROJECT_DIR}/Common"
23
MAVEN_REPO="${HOME}/.m2/repository"
24
 
25
DATE=`date +%Y-%b-%d_%Hh%Mm`
26
LOGERR=error-${DATE}.log
27
 
28
touch ${LOGERR}
29
exec 7>&2           # Link file descriptor #7 with stderr.
30
                    # Saves stderr.
31
exec 2> ${LOGERR}     # stderr replaced with file ${LOGERR}.
32
 
33
echo "Starting python services"
34
echo "======================================================================="
35
#start services
36
export 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.egg
37
 
38
killall -9 python2.6
39
/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 &
40
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/catalog/CatalogServer.py >> ${LOGDIR}/catalog.log 2>&1 &
41
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/user/UserContextServer.py >> ${LOGDIR}/user.log 2>&1 &
42
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/order/TransactionServer.py >> ${LOGDIR}/order.log 2>&1 &
43
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/logistics/service/LogisticsServer.py >> ${LOGDIR}/logistics.log 2>&1 &
44
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/helpers/impl/HelperServer.py >>  ${LOGDIR}/helpers.log 2>&1 &
45
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/payments/PaymentsServer.py >> ${LOGDIR}/payments.log 2>&1 &
2002 rajveer 46
/usr/bin/python2.6 -u $PROJECT_DIR/PyProj/src/shop2020/model/v1/user/PromotionServer.py >> ${LOGDIR}/promotion.log 2>&1 &
1652 rajveer 47
/usr/bin/python2.6 -u /root/trunk-chkout/trunk/PyProj/src/shop2020/helpers/impl/EmailSender.py >>  ${LOGDIR}/emailsender.log 2>&1 &
48
 
49
echo "Started python services"
50
echo "======================================================================="
51
 
52
echo "Starting Tomcat"
53
echo "======================================================================="
54
# deploy war and start tomcat
55
/etc/init.d/tomcat6 stop
1741 rajveer 56
rm -rf ${TOMCAT_HOME}/webapps/ROOT* ${TOMCAT_HOME}/webapps/Support* ${TOMCAT_HOME}/webapps/Social*
1652 rajveer 57
cp ${MAVEN_REPO}/in/shop2020/Website/1.0-SNAPSHOT/Website-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/ROOT.war
58
cp ${MAVEN_REPO}/in/shop2020/Support/1.0-SNAPSHOT/Support-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/Support.war
1741 rajveer 59
cp ${MAVEN_REPO}/in/shop2020/Social/1.0-SNAPSHOT/Social-1.0-SNAPSHOT.war ${TOMCAT_HOME}/webapps/Social.war
1652 rajveer 60
/etc/init.d/tomcat6 start
61
sleep 5
62
echo "Started tomcat"
63
echo "======================================================================="
64
 
65
#Clean up IO redirection
66
exec 2>&7 7>&-      # Restore stdout and close file descriptor #7.