fix script
Project: http://git-wip-us.apache.org/repos/asf/incubator-kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-kylin/commit/c714097e Tree: http://git-wip-us.apache.org/repos/asf/incubator-kylin/tree/c714097e Diff: http://git-wip-us.apache.org/repos/asf/incubator-kylin/diff/c714097e Branch: refs/heads/inverted-index Commit: c714097eedf7110b6b326c9e820191be33c857d5 Parents: 75431e3 Author: qianhao.zhou <qianz...@ebay.com> Authored: Wed Feb 11 15:39:15 2015 +0800 Committer: qianhao.zhou <qianz...@ebay.com> Committed: Wed Feb 11 15:39:15 2015 +0800 ---------------------------------------------------------------------- bin/start-kylin.sh | 2 +- bin/stop-kylin.sh | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/c714097e/bin/start-kylin.sh ---------------------------------------------------------------------- diff --git a/bin/start-kylin.sh b/bin/start-kylin.sh index 9225fb6..b2544a5 100755 --- a/bin/start-kylin.sh +++ b/bin/start-kylin.sh @@ -46,7 +46,7 @@ hbase -Djava.util.logging.config.file=${tomcat_root}/conf/logging.properties \ -Djava.io.tmpdir=${tomcat_root}/temp \ -Dkylin.hive.dependency=${hive_dependency} \ -Dspring.profiles.active=${spring_profile} \ -org.apache.hadoop.util.RunJar ${tomcat_root}/bin/bootstrap.jar org.apache.catalina.startup.Bootstrap start > ${tomcat_root}/logs/kylin.log 2>&1 & +org.apache.hadoop.util.RunJar ${tomcat_root}/bin/bootstrap.jar org.apache.catalina.startup.Bootstrap start > ${tomcat_root}/logs/kylin.log 2>&1 & echo $! > ${KYLIN_HOME}/pid & echo "A new Kylin instance is started by $USER, stop it using \"stop-kylin.sh\"" if [ "$useSandbox" = "true" ] then echo "Please visit http://<your_sandbox_ip>:7070/kylin to play with the cubes! (Useranme: ADMIN, Password: KYLIN)" http://git-wip-us.apache.org/repos/asf/incubator-kylin/blob/c714097e/bin/stop-kylin.sh ---------------------------------------------------------------------- diff --git a/bin/stop-kylin.sh b/bin/stop-kylin.sh index 806513b..4ac8b7c 100755 --- a/bin/stop-kylin.sh +++ b/bin/stop-kylin.sh @@ -1,4 +1,12 @@ #!/bin/sh -ps -fu $USER | grep tomcat | grep -v "grep" | awk '{print $2}' | xargs kill -echo "all tomcats started by $USER are killed" \ No newline at end of file +pid=`cat ${KYLIN_HOME}/pid || echo "no pid found";exit 1` +if [ ! "$pid" = "" ] +then + echo "no pid found" + exit 1 +else + echo "stopping pid:$pid" + kill $pid +fi +rm ${KYLIN_HOME}/pid