knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject git commit: KNOX-68: Fix start/stop script for gateway to work with more platforms (e.g. macos).
Date Wed, 15 May 2013 21:23:49 GMT
Updated Branches:
  refs/heads/master 0d2d0d420 -> b395dfe3b


KNOX-68: Fix start/stop script for gateway to work with more platforms (e.g. macos).


Project: http://git-wip-us.apache.org/repos/asf/incubator-knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-knox/commit/b395dfe3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/b395dfe3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/b395dfe3

Branch: refs/heads/master
Commit: b395dfe3bb065b8f980b9e8ba438ac3bb89a9af3
Parents: 0d2d0d4
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Wed May 15 17:23:44 2013 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Wed May 15 17:23:44 2013 -0400

----------------------------------------------------------------------
 gateway-release/home/bin/knox.sh |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/b395dfe3/gateway-release/home/bin/knox.sh
----------------------------------------------------------------------
diff --git a/gateway-release/home/bin/knox.sh b/gateway-release/home/bin/knox.sh
index 2b8b884..0ff9066 100644
--- a/gateway-release/home/bin/knox.sh
+++ b/gateway-release/home/bin/knox.sh
@@ -35,13 +35,11 @@ KNOX_JAR="$KNOX_SCRIPT_DIR/server.jar"
 #Name of PID file
 PID_DIR="/var/run/$KNOX_NAME"
 PID_FILE="$PID_DIR/$KNOX_NAME.pid"
-PID_PERM_FILE="$PID_DIR/$KNOX_NAME.perm"
 
 #Name of LOG/OUT/ERR file
 LOG_DIR="/var/log/$KNOX_NAME"
 OUT_FILE="$LOG_DIR/$KNOX_NAME.out"
 ERR_FILE="$LOG_DIR/$KNOX_NAME.err"
-LOG_PERM_FILE="$LOG_DIR/$KNOX_NAME.perm"
 
 #The max time to wait
 MAX_WAIT_TIME=10
@@ -79,10 +77,7 @@ function knoxStart {
    
    rm -f $PID_FILE
 
-   echo $KNOX_JAR
-   echo $ERR_FILE
-   echo $PID_FILE
-   nohup java -jar $KNOX_JAR >> $OUT_FILE 2>>$ERR_FILE & printf $! >$PID_FILE
"\n"|| return 1
+   nohup java -jar $KNOX_JAR >>$OUT_FILE 2>>$ERR_FILE & printf $!>$PID_FILE
|| return 1
    
    getPID
    knoxIsRunning $PID
@@ -166,8 +161,15 @@ function getPID {
 }
 
 function knoxIsRunning {
-   if [ -e /proc/$1 ]; then return 1; fi
-   return 0
+   if [ $1 -eq 0 ]; then return 0; fi
+
+   ps -p $1 > /dev/null
+
+   if [ $? -eq 1 ]; then
+     return 0
+   else
+     return 1
+   fi
 }
 
 function knoxKill {


Mime
View raw message