From cfc26f42b310c4b1fe626b6b2faa3c932ef24d4e Mon Sep 17 00:00:00 2001 From: sunqi310 Date: Wed, 21 Sep 2016 17:19:59 +0800 Subject: TOSCA-68 Modify start and stop script.so that we can run or stop catalog service at any path Change-Id: I98fbf875f163a0e2116e0667d2e4c7e03d5d8e5d Issue-id: TOSCA-68 Signed-off-by: sunqi310 --- .../distribution/catalog-all/src/main/assembly/shutdown.sh | 4 ++-- catalog-core/distribution/catalog-all/src/main/assembly/startup.sh | 7 +++++-- .../distribution/catalog-standalone/src/main/assembly/initDB.bat | 4 ++-- .../distribution/catalog-standalone/src/main/assembly/initDB.sh | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh index 25a9bd90..268bc82b 100644 --- a/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh +++ b/catalog-core/distribution/catalog-all/src/main/assembly/shutdown.sh @@ -20,11 +20,11 @@ echo @RUNHOME@ $RUNHOME echo "### Starting catalog"; cd catalog -./stop.sh & +$RUNHOME/catalog/stop.sh & cd $RUNHOME echo "\n\n### Starting catalog-http server" cd ./tomcat -./bin/shutdown.sh & +$RUNHOME/tomcat/bin/shutdown.sh & echo "### Starting catalog end..."; diff --git a/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh b/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh index 41696fb1..ed5daa7d 100644 --- a/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh +++ b/catalog-core/distribution/catalog-all/src/main/assembly/startup.sh @@ -21,12 +21,15 @@ echo @RUNHOME@ $RUNHOME echo "### Starting catalog"; cd catalog -./run.sh & +$RUNHOME/catalog/run.sh & cd $RUNHOME echo "\n\n### Starting catalog-http server" cd ./tomcat -./bin/startup.sh & +if [ ! -d "$RUNHOME/tomcat/logs" ]; then + mkdir $RUNHOME/tomcat/logs +fi +$RUNHOME/tomcat/bin/startup.sh & echo "### Starting catalog end..."; diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat index 6663e3d7..0276d6f1 100644 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.bat @@ -22,9 +22,9 @@ set password=%2 set port=%3 set host=%4 echo start init catalog db -echo HOME=$HOME +echo HOME=%HOME% cd /d %HOME% -mysql -u%user% -p%password% -P%port% -h%host% < dbscripts\mysql\openo-common_tosca-catalog-createobj.sql +mysql -u%user% -p%password% -P%port% -h%host% < %HOME%\dbscripts\mysql\openo-common_tosca-catalog-createobj.sql set "err=%errorlevel%" if "%err%"=="0" ( echo init catalog db success diff --git a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh index 2e5cd323..70d78fef 100644 --- a/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh +++ b/catalog-core/distribution/catalog-standalone/src/main/assembly/initDB.sh @@ -23,7 +23,7 @@ password=$2 port=$3 host=$4 echo "start init catalog db" -mysql -u$user -p$password -P$port -h$host