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 2014/10/24 22:39:28 UTC

git commit: KNOX-433: Startup Script for Apache Knox

Repository: knox
Updated Branches:
  refs/heads/master 73160feac -> 1140aee65


KNOX-433: Startup Script for Apache Knox


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

Branch: refs/heads/master
Commit: 1140aee65a56c3a66849c9eae0a554f3c45f17e1
Parents: 73160fe
Author: Kevin Minder <ke...@hortonworks.com>
Authored: Fri Oct 24 11:05:30 2014 -0400
Committer: Kevin Minder <ke...@hortonworks.com>
Committed: Fri Oct 24 11:05:30 2014 -0400

----------------------------------------------------------------------
 gateway-release/home/templates/knox | 64 ++++++++++++++++++++++++++++++++
 1 file changed, 64 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/knox/blob/1140aee6/gateway-release/home/templates/knox
----------------------------------------------------------------------
diff --git a/gateway-release/home/templates/knox b/gateway-release/home/templates/knox
new file mode 100644
index 0000000..f1bacde
--- /dev/null
+++ b/gateway-release/home/templates/knox
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Run-level Startup script for Apache Knox Gateway
+#
+# chkconfig: 345 85 15
+# description: Startup/Shutdown Apache Knox Gateway
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# /etc/init.d/knox
+
+VERSION="0.5.0.2.2"
+
+KNOX_HOME="/usr/hdp/current/knox-server"
+KNOX_USER="knox"
+
+# if the executables do not exist -- display error
+
+if [ ! -f $KNOX_HOME/bin/gateway.sh -o ! -d $KNOX_HOME ]
+then
+        echo "Apache Knox Gateway startup: cannot start"
+        exit 1
+fi
+
+# depending on parameter -- startup, shutdown, restart
+# of the instance and listener or usage display
+
+case "$1" in
+    start)
+        echo -n "Starting Apache Knox Gateway: "
+        su - $KNOX_USER -c "$KNOX_HOME/bin/gateway.sh start"
+        ;;
+    stop)
+        echo -n "Shutdown Apache Knox Gateway: "
+        su - $KNOX_USER -c "$KNOX_HOME/bin/gateway.sh stop"
+        ;;
+    status)
+        echo -n "Checking Apache Knox Gateway Status: "
+        su - $KNOX_USER -c "$KNOX_HOME/bin/gateway.sh status"
+        ;;
+    reload|restart)
+        $0 stop
+        $0 start
+        ;;
+    *)
+        echo "Usage: $0 start|stop|status|restart|reload"
+        exit 1
+esac
+
+exit 0