You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by lm...@apache.org on 2013/12/06 16:59:52 UTC
[2/3] git commit: KNOX-205: Launcher script gateway sh not working
when gateway installed via RPM
KNOX-205: Launcher script gateway sh not working when gateway installed via RPM
Project: http://git-wip-us.apache.org/repos/asf/incubator-knox/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-knox/commit/43f00234
Tree: http://git-wip-us.apache.org/repos/asf/incubator-knox/tree/43f00234
Diff: http://git-wip-us.apache.org/repos/asf/incubator-knox/diff/43f00234
Branch: refs/heads/v0.3.1
Commit: 43f002341f402699a14825f90d4dbeb5c8cc3468
Parents: fac427d
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Fri Nov 22 09:48:04 2013 -0500
Committer: Larry McCay <lm...@hortonworks.com>
Committed: Fri Dec 6 10:53:19 2013 -0500
----------------------------------------------------------------------
gateway-release/home/bin/gateway.sh | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/43f00234/gateway-release/home/bin/gateway.sh
----------------------------------------------------------------------
diff --git a/gateway-release/home/bin/gateway.sh b/gateway-release/home/bin/gateway.sh
index eb58e91..2812a80 100755
--- a/gateway-release/home/bin/gateway.sh
+++ b/gateway-release/home/bin/gateway.sh
@@ -29,6 +29,9 @@ KNOX_LAUNCH_USER=$2
# start/stop script location
KNOX_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+# GATEWAY_HOME
+KNOX_HOME=`dirname $KNOX_SCRIPT_DIR`
+
#App name
KNOX_NAME=knox
@@ -86,8 +89,8 @@ function knoxStart {
rm -f $PID_FILE
- nohup java -jar $KNOX_JAR >>$OUT_FILE 2>>$ERR_FILE & printf $!>$PID_FILE || exit 1
-
+ nohup java -DGATEWAY_HOME=$KNOX_HOME -jar $KNOX_JAR >>$OUT_FILE 2>>$ERR_FILE & printf $!>$PID_FILE || exit 1
+
getPID
knoxIsRunning $PID
if [ $? -ne 1 ]; then
@@ -255,10 +258,7 @@ function setupEnv {
exit 1
fi
- setDirPermission $PID_DIR $userName
- setDirPermission $LOG_DIR $userName
-
- sudo -u $userName java -jar $KNOX_JAR -persist-master -nostart
+ java -DGATEWAY_HOME=$KNOX_HOME -jar $KNOX_JAR -persist-master -nostart
return 0
}