From c1e2e687457f691fb973d024dc9f157b394696ab Mon Sep 17 00:00:00 2001 From: "peng.jianhua" Date: Mon, 11 Dec 2017 15:39:16 +0800 Subject: [PATCH 1/1] KYLIN-3099 Add restart operation for kylin.sh --- build/bin/kylin.sh | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/build/bin/kylin.sh b/build/bin/kylin.sh index bf1c862..2b2e861 100755 --- a/build/bin/kylin.sh +++ b/build/bin/kylin.sh @@ -55,9 +55,7 @@ function retrieveDependency() { verbose "HBASE_CLASSPATH: ${HBASE_CLASSPATH}" } -# start command -if [ "$1" == "start" ] -then +function onStart() { if [ -f "${KYLIN_HOME}/pid" ] then PID=`cat $KYLIN_HOME/pid` @@ -128,11 +126,9 @@ then kylin_server_port=`sed -n "s/:${kylin_server_port}/kylin" - exit 0 +} -# stop command -elif [ "$1" == "stop" ] -then +function onStop() { if [ -f "${KYLIN_HOME}/pid" ] then PID=`cat $KYLIN_HOME/pid` @@ -170,13 +166,30 @@ then # process is killed , remove pid file rm -rf ${KYLIN_HOME}/pid echo "Kylin with pid ${PID} has been stopped." - exit 0 else - quit "Kylin with pid ${PID} is not running" + echo "Kylin with pid ${PID} is not running" fi else - quit "Kylin is not running" + echo "Kylin is not running" fi +} + +# start command +if [ "$1" == "start" ] +then + onStart + exit 0 +# stop command +elif [ "$1" == "stop" ] +then + onStop + exit 0 +# restart command +elif [ "$1" == "restart" ] +then + onStop + onStart + exit 0 elif [ "$1" = "version" ] then retrieveDependency -- 2.7.2.windows.1