You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@knox.apache.org by km...@apache.org on 2013/09/30 22:17:03 UTC

git commit: KNOX-153: More usability tweaks for negative use cases.

Updated Branches:
  refs/heads/master c72c1327e -> af92049c7


KNOX-153: More usability tweaks for negative use cases.


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

Branch: refs/heads/master
Commit: af92049c7d27cabd5c158c19848882da5c4ab487
Parents: c72c132
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Mon Sep 30 16:16:54 2013 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Mon Sep 30 16:17:00 2013 -0400

----------------------------------------------------------------------
 gateway-release/home/bin/gateway.sh | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-knox/blob/af92049c/gateway-release/home/bin/gateway.sh
----------------------------------------------------------------------
diff --git a/gateway-release/home/bin/gateway.sh b/gateway-release/home/bin/gateway.sh
index a6b0505..eb58e91 100755
--- a/gateway-release/home/bin/gateway.sh
+++ b/gateway-release/home/bin/gateway.sh
@@ -153,6 +153,10 @@ function knoxClean {
 
 # Returns 0 if the Knox is running and sets the $PID variable.
 function getPID {
+   if [ ! -d $PID_DIR ]; then
+      printf "Can't find pid dir.  Run sudo $0 setup.\n"
+      exit 1
+   fi
    if [ ! -f $PID_FILE ]; then
      PID=0
      return 1
@@ -194,6 +198,10 @@ function knoxKill {
 }
 
 function createLogFiles {
+   if [ ! -d "$LOG_DIR" ]; then
+      printf "Can't find log dir.  Run sudo $0 setup.\n"
+      exit 1
+   fi
    if [ ! -f "$OUT_FILE" ]; then touch $OUT_FILE; fi
    if [ ! -f "$ERR_FILE" ]; then touch $ERR_FILE; fi   
 }
@@ -215,7 +223,7 @@ function setDirPermission {
 
    if [ ! -d "$dirName" ]; then mkdir -p $dirName; fi
    if [ $? -ne 0 ]; then
-      printf "Can't access or create \"$dirName\" folder.  Run command with sudo.\n"
+      printf "Can't access or create \"$dirName\" folder.  Run sudo $0 setup.\n"
       exit 1
    fi