Skip to content
Browse files

Merge pull request #803 from rvs/OOZIE-792

Closes OOZIE-792 oozie-stop.sh is oblivious to 'catalina.sh stop' failing
  • Loading branch information...
2 parents 2670d1e + a907829 commit 0eb99a92548165e67645d06a4962fcae525df7a4 @mislam77 mislam77 committed
View
37 distro/src/main/bin/oozie-run.sh
@@ -30,39 +30,4 @@ done
BASEDIR=`dirname ${PRG}`
BASEDIR=`cd ${BASEDIR}/..;pwd`
-source ${BASEDIR}/bin/oozie-sys.sh
-
-# The Java System property 'oozie.http.port' it is not used by Oozie,
-# it is used in Tomcat's server.xml configuration file
-#
-echo "Using CATALINA_OPTS: ${CATALINA_OPTS}"
-
-catalina_opts="-Doozie.home.dir=${OOZIE_HOME}";
-catalina_opts="${catalina_opts} -Doozie.config.dir=${OOZIE_CONFIG}";
-catalina_opts="${catalina_opts} -Doozie.log.dir=${OOZIE_LOG}";
-catalina_opts="${catalina_opts} -Doozie.data.dir=${OOZIE_DATA}";
-
-catalina_opts="${catalina_opts} -Doozie.config.file=${OOZIE_CONFIG_FILE}";
-
-catalina_opts="${catalina_opts} -Doozie.log4j.file=${OOZIE_LOG4J_FILE}";
-catalina_opts="${catalina_opts} -Doozie.log4j.reload=${OOZIE_LOG4J_RELOAD}";
-
-catalina_opts="${catalina_opts} -Doozie.http.hostname=${OOZIE_HTTP_HOSTNAME}";
-catalina_opts="${catalina_opts} -Doozie.http.port=${OOZIE_HTTP_PORT}";
-catalina_opts="${catalina_opts} -Doozie.base.url=${OOZIE_BASE_URL}";
-
-echo "Adding to CATALINA_OPTS: ${catalina_opts}"
-
-export CATALINA_OPTS="${CATALINA_OPTS} ${catalina_opts}"
-
-if [ ! -e "${CATALINA_BASE}/webapps/oozie.war" ]; then
- echo "WARN: Oozie WAR has not been set up at ''${CATALINA_BASE}/webapps'', doing default set up"
- ${BASEDIR}/bin/oozie-setup.sh
- if [ "$?" != "0" ]; then
- exit -1
- fi
-fi
-echo
-
-${BASEDIR}/oozie-server/bin/catalina.sh run
-
+exec ${BASEDIR}/bin/oozied.sh run
View
47 distro/src/main/bin/oozie-start.sh
@@ -30,49 +30,4 @@ done
BASEDIR=`dirname ${PRG}`
BASEDIR=`cd ${BASEDIR}/..;pwd`
-source ${BASEDIR}/bin/oozie-sys.sh
-
-# The Java System property 'oozie.http.port' it is not used by Oozie,
-# it is used in Tomcat's server.xml configuration file
-#
-echo "Using CATALINA_OPTS: ${CATALINA_OPTS}"
-
-catalina_opts="-Doozie.home.dir=${OOZIE_HOME}";
-catalina_opts="${catalina_opts} -Doozie.config.dir=${OOZIE_CONFIG}";
-catalina_opts="${catalina_opts} -Doozie.log.dir=${OOZIE_LOG}";
-catalina_opts="${catalina_opts} -Doozie.data.dir=${OOZIE_DATA}";
-
-catalina_opts="${catalina_opts} -Doozie.config.file=${OOZIE_CONFIG_FILE}";
-
-catalina_opts="${catalina_opts} -Doozie.log4j.file=${OOZIE_LOG4J_FILE}";
-catalina_opts="${catalina_opts} -Doozie.log4j.reload=${OOZIE_LOG4J_RELOAD}";
-
-catalina_opts="${catalina_opts} -Doozie.http.hostname=${OOZIE_HTTP_HOSTNAME}";
-catalina_opts="${catalina_opts} -Doozie.http.port=${OOZIE_HTTP_PORT}";
-catalina_opts="${catalina_opts} -Doozie.base.url=${OOZIE_BASE_URL}";
-
-echo "Adding to CATALINA_OPTS: ${catalina_opts}"
-
-export CATALINA_OPTS="${CATALINA_OPTS} ${catalina_opts}"
-
-if [ ! -e "${CATALINA_BASE}/webapps/oozie.war" ]; then
- echo "WARN: Oozie WAR has not been set up at ''${CATALINA_BASE}/webapps'', doing default set up"
- ${BASEDIR}/bin/oozie-setup.sh
- if [ "$?" != "0" ]; then
- exit -1
- fi
-fi
-echo
-
-${BASEDIR}/oozie-server/bin/catalina.sh start
-
-if [ "$?" = "0" ]; then
- echo
- echo "Oozie started"
- echo
-else
- echo
- echo "ERROR: Oozie start aborted"
- echo
-fi
-
+exec ${BASEDIR}/bin/oozied.sh start
View
15 distro/src/main/bin/oozie-stop.sh
@@ -30,17 +30,4 @@ done
BASEDIR=`dirname ${PRG}`
BASEDIR=`cd ${BASEDIR}/..;pwd`
-source ${BASEDIR}/bin/oozie-sys.sh
-
-${BASEDIR}/oozie-server/bin/catalina.sh stop
-
-if [ "$?" = "0" ]; then
- echo
- echo "Oozie stopped"
- echo
-else
- echo
- echo "ERROR: Oozie stop aborted"
- echo
-fi
-
+exec ${BASEDIR}/bin/oozied.sh stop
View
102 distro/src/main/bin/oozied.sh
@@ -0,0 +1,102 @@
+#!/bin/bash
+#
+# Copyright (c) 2010 Yahoo! Inc. All rights reserved.
+# Licensed 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. See accompanying LICENSE file.
+#
+
+if [ $# -le 0 ]; then
+ echo "Usage: oozied.sh (start|stop|run) [<catalina-args...>]"
+ exit 1
+fi
+
+actionCmd=$1
+shift
+
+# resolve links - $0 may be a softlink
+PRG="${0}"
+
+while [ -h "${PRG}" ]; do
+ ls=`ls -ld "${PRG}"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "${PRG}"`/"$link"
+ fi
+done
+
+BASEDIR=`dirname ${PRG}`
+BASEDIR=`cd ${BASEDIR}/..;pwd`
+
+source ${BASEDIR}/bin/oozie-sys.sh
+
+CATALINA=${BASEDIR}/oozie-server/bin/catalina.sh
+
+setup_catalina_opts() {
+ # The Java System property 'oozie.http.port' it is not used by Oozie,
+ # it is used in Tomcat's server.xml configuration file
+ #
+ echo "Using CATALINA_OPTS: ${CATALINA_OPTS}"
+
+ catalina_opts="-Doozie.home.dir=${OOZIE_HOME}";
+ catalina_opts="${catalina_opts} -Doozie.config.dir=${OOZIE_CONFIG}";
+ catalina_opts="${catalina_opts} -Doozie.log.dir=${OOZIE_LOG}";
+ catalina_opts="${catalina_opts} -Doozie.data.dir=${OOZIE_DATA}";
+
+ catalina_opts="${catalina_opts} -Doozie.config.file=${OOZIE_CONFIG_FILE}";
+
+ catalina_opts="${catalina_opts} -Doozie.log4j.file=${OOZIE_LOG4J_FILE}";
+ catalina_opts="${catalina_opts} -Doozie.log4j.reload=${OOZIE_LOG4J_RELOAD}";
+
+ catalina_opts="${catalina_opts} -Doozie.http.hostname=${OOZIE_HTTP_HOSTNAME}";
+ catalina_opts="${catalina_opts} -Doozie.http.port=${OOZIE_HTTP_PORT}";
+ catalina_opts="${catalina_opts} -Doozie.base.url=${OOZIE_BASE_URL}";
+
+ echo "Adding to CATALINA_OPTS: ${catalina_opts}"
+
+ export CATALINA_OPTS="${CATALINA_OPTS} ${catalina_opts}"
+}
+
+setup_oozie() {
+ if [ ! -e "${CATALINA_BASE}/webapps/oozie.war" ]; then
+ echo "WARN: Oozie WAR has not been set up at ''${CATALINA_BASE}/webapps'', doing default set up"
+ ${BASEDIR}/bin/oozie-setup.sh
+ if [ "$?" != "0" ]; then
+ exit -1
+ fi
+ fi
+ echo
+}
+
+case $actionCmd in
+ (start|run)
+ setup_catalina_opts
+ setup_oozie
+ $CATALINA $actionCmd "$@"
+ ;;
+ (stop)
+ $CATALINA $actionCmd "$@"
+ ;;
+esac
+
+if [ "$?" = "0" ]; then
+ echo
+ echo "Oozie $actionCmd succeeded"
+ echo
+ exit 0
+else
+ echo
+ echo "ERROR: Oozie $actionCmd aborted"
+ echo
+ exit 1
+fi
View
1 release-log.txt
@@ -25,6 +25,7 @@ OOZIE-98 parametrization of 'name' attribute in workflow/coordinator/bundle
OOZIE-106 add new queue class to iterate next callable when current callable type has reached max concorrency
OOZIE-108 Upgrade pom version to 3.1.0.
OOZIE-133 Fs 'move' action made consistent and able to have existing target dir
+OOZIE-792 oozie-stop.sh is oblivious to 'catalina.sh stop' failing
-- Oozie 3.0.2 release

0 comments on commit 0eb99a9

Please sign in to comment.
Something went wrong with that request. Please try again.