knox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kmin...@apache.org
Subject [1/2] git commit: KNOX-433: Startup Script for Apache Knox
Date Fri, 24 Oct 2014 21:00:43 GMT
Repository: knox
Updated Branches:
  refs/heads/v0.5.0 22c466a11 -> 799814148


KNOX-433: Startup Script for Apache Knox

(cherry picked from commit 1140aee65a56c3a66849c9eae0a554f3c45f17e1)


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

Branch: refs/heads/v0.5.0
Commit: 2803f7bdf8239dd0557b82d34b610533b16db6f2
Parents: 22c466a
Author: Kevin Minder <kevin.minder@hortonworks.com>
Authored: Fri Oct 24 11:05:30 2014 -0400
Committer: Kevin Minder <kevin.minder@hortonworks.com>
Committed: Fri Oct 24 16:42:09 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/knox/blob/2803f7bd/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


Mime
View raw message