You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by dp...@apache.org on 2019/02/15 14:29:00 UTC

[ignite] branch master updated: IGNITE-11216 Ignite.sh fails on Mac OS and Linux - Java 11 (#6095)

This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 832f3a2  IGNITE-11216 Ignite.sh fails on Mac OS and Linux - Java 11 (#6095)
832f3a2 is described below

commit 832f3a2f39942a870111d3509f8cf0f32197a0f0
Author: Peter Ivanov <mr...@gmail.com>
AuthorDate: Fri Feb 15 17:28:52 2019 +0300

    IGNITE-11216 Ignite.sh fails on Mac OS and Linux - Java 11 (#6095)
---
 bin/control.sh                 | 40 +++++++++++++++++++++++-----------------
 bin/ignite-tf.sh               | 24 +++++++++++++++---------
 bin/ignitevisorcmd.sh          | 12 +++++++++---
 bin/include/parseargs.sh       |  2 +-
 modules/sqlline/bin/sqlline.sh | 14 ++++++++++----
 5 files changed, 58 insertions(+), 34 deletions(-)

diff --git a/bin/control.sh b/bin/control.sh
index a883bc8..90bd7b8 100755
--- a/bin/control.sh
+++ b/bin/control.sh
@@ -1,4 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -o nounset
+set -o errexit
+set -o pipefail
+set -o errtrace
+set -o functrace
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -23,7 +29,7 @@
 #
 # Import common functions.
 #
-if [ "${IGNITE_HOME}" = "" ];
+if [ "${IGNITE_HOME:-}" = "" ];
     then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
     else IGNITE_HOME_TMP=${IGNITE_HOME};
 fi
@@ -45,7 +51,7 @@ checkJava
 #
 setIgniteHome
 
-if [ "${DEFAULT_CONFIG}" == "" ]; then
+if [ "${DEFAULT_CONFIG:-}" == "" ]; then
     DEFAULT_CONFIG=config/default-config.xml
 fi
 
@@ -68,14 +74,14 @@ RESTART_SUCCESS_OPT="-DIGNITE_SUCCESS_FILE=${RESTART_SUCCESS_FILE}"
 #
 # This is executed when -nojmx is not specified
 #
-if [ "${NOJMX}" == "0" ] ; then
+if [ "${NOJMXI:-}" == "0" ] ; then
     findAvailableJmxPort
 fi
 
 # Mac OS specific support to display correct name in the dock.
 osname=`uname`
 
-if [ "${DOCK_OPTS}" == "" ]; then
+if [ "${DOCK_OPTS:-}" == "" ]; then
     DOCK_OPTS="-Xdock:name=Ignite Node"
 fi
 
@@ -84,7 +90,7 @@ fi
 #
 # ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
 #
-if [ -z "$JVM_OPTS" ] ; then
+if [ -z "${JVM_OPTS:-}" ] ; then
     if [[ `"$JAVA" -version 2>&1 | egrep "1\.[7]\."` ]]; then
         JVM_OPTS="-Xms256m -Xmx1g"
     else
@@ -122,14 +128,14 @@ ENABLE_ASSERTIONS="1"
 #
 # Set '-ea' options if assertions are enabled.
 #
-if [ "${ENABLE_ASSERTIONS}" = "1" ]; then
+if [ "${ENABLE_ASSERTIONS:-}" = "1" ]; then
     JVM_OPTS="${JVM_OPTS} -ea"
 fi
 
 #
 # Set main class to start service (grid node by default).
 #
-if [ "${MAIN_CLASS}" = "" ]; then
+if [ "${MAIN_CLASS:-}" = "" ]; then
     MAIN_CLASS=org.apache.ignite.internal.commandline.CommandHandler
 fi
 
@@ -177,30 +183,30 @@ ERRORCODE="-1"
 
 while [ "${ERRORCODE}" -ne "130" ]
 do
-    if [ "${INTERACTIVE}" == "1" ] ; then
+    if [ "${INTERACTIVE:-}" == "1" ] ; then
         case $osname in
             Darwin*)
-                "$JAVA" ${JVM_OPTS} ${QUIET} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}" ${JMX_MON} \
+                "$JAVA" ${JVM_OPTS} ${QUIET:-} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}" ${JMX_MON:-} \
                 -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-                -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS} -cp "${CP}" ${MAIN_CLASS} $@
+                -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} $@
             ;;
             *)
-                "$JAVA" ${JVM_OPTS} ${QUIET} "${RESTART_SUCCESS_OPT}" ${JMX_MON} \
+                "$JAVA" ${JVM_OPTS} ${QUIET:-} "${RESTART_SUCCESS_OPT}" ${JMX_MON:-} \
                 -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-                -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS} -cp "${CP}" ${MAIN_CLASS} $@
+                -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} $@
             ;;
         esac
     else
         case $osname in
             Darwin*)
-                "$JAVA" ${JVM_OPTS} ${QUIET} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}" ${JMX_MON} \
+                "$JAVA" ${JVM_OPTS} ${QUIET:-} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}" ${JMX_MON:-} \
                  -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-                 -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS} -cp "${CP}" ${MAIN_CLASS} $@
+                 -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} $@
             ;;
             *)
-                "$JAVA" ${JVM_OPTS} ${QUIET} "${RESTART_SUCCESS_OPT}" ${JMX_MON} \
+                "$JAVA" ${JVM_OPTS} ${QUIET:-} "${RESTART_SUCCESS_OPT}" ${JMX_MON:-} \
                  -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-                 -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS} -cp "${CP}" ${MAIN_CLASS} $@
+                 -DIGNITE_PROG_NAME="$0" ${JVM_XOPTS:-} -cp "${CP}" ${MAIN_CLASS} $@
             ;;
         esac
     fi
diff --git a/bin/ignite-tf.sh b/bin/ignite-tf.sh
index a6499ae..9eb336a 100755
--- a/bin/ignite-tf.sh
+++ b/bin/ignite-tf.sh
@@ -1,4 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -o nounset
+set -o errexit
+set -o pipefail
+set -o errtrace
+set -o functrace
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -23,7 +29,7 @@
 #
 # Import common functions.
 #
-if [ "${IGNITE_HOME}" = "" ];
+if [ "${IGNITE_HOME:-}" = "" ];
     then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
     else IGNITE_HOME_TMP=${IGNITE_HOME};
 fi
@@ -45,7 +51,7 @@ checkJava
 #
 setIgniteHome
 
-if [ "${DEFAULT_CONFIG}" == "" ]; then
+if [ "${DEFAULT_CONFIG:-}" == "" ]; then
     DEFAULT_CONFIG=config/default-config.xml
 fi
 
@@ -65,7 +71,7 @@ RESTART_SUCCESS_OPT="-DIGNITE_SUCCESS_FILE=${RESTART_SUCCESS_FILE}"
 # Mac OS specific support to display correct name in the dock.
 osname=`uname`
 
-if [ "${DOCK_OPTS}" == "" ]; then
+if [ "${DOCK_OPTS:-}" == "" ]; then
     DOCK_OPTS="-Xdock:name=Ignite Node"
 fi
 
@@ -74,7 +80,7 @@ fi
 #
 # ADD YOUR/CHANGE ADDITIONAL OPTIONS HERE
 #
-if [ -z "$JVM_OPTS" ] ; then
+if [ -z "${JVM_OPTS:-}" ] ; then
     JVM_OPTS="-Xms1g -Xmx1g -server -XX:MaxMetaspaceSize=256m"
 fi
 
@@ -103,7 +109,7 @@ ENABLE_ASSERTIONS="1"
 #
 # Set '-ea' options if assertions are enabled.
 #
-if [ "${ENABLE_ASSERTIONS}" = "1" ]; then
+if [ "${ENABLE_ASSERTIONS:-}" = "1" ]; then
     JVM_OPTS="${JVM_OPTS} -ea"
 fi
 
@@ -158,12 +164,12 @@ while [ "${ERRORCODE}" -ne "130" ]
 do
     case $osname in
         Darwin*)
-            "$JAVA" ${JVM_OPTS} ${QUIET} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}"  \
+            "$JAVA" ${JVM_OPTS:-} ${QUIET:-} "${DOCK_OPTS}" "${RESTART_SUCCESS_OPT}"  \
              -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
-             -DIGNITE_PROG_NAME="$0" -cp "${CP}" ${MAIN_CLASS} "${CONFIG}" "$@"
+             -DIGNITE_PROG_NAME="$0" -cp "${CP}" ${MAIN_CLASS} "${CONFIG:-}" "$@"
         ;;
         *)
-            "$JAVA" ${JVM_OPTS} ${QUIET} "${RESTART_SUCCESS_OPT}" \
+            "$JAVA" ${JVM_OPTS:-} ${QUIET:-} "${RESTART_SUCCESS_OPT}" \
              -DIGNITE_UPDATE_NOTIFIER=false -DIGNITE_HOME="${IGNITE_HOME}" \
              -DIGNITE_PROG_NAME="$0" -cp "${CP}" ${MAIN_CLASS} "$@"
         ;;
diff --git a/bin/ignitevisorcmd.sh b/bin/ignitevisorcmd.sh
index 077f051..523f85c 100755
--- a/bin/ignitevisorcmd.sh
+++ b/bin/ignitevisorcmd.sh
@@ -1,4 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -o nounset
+set -o errexit
+set -o pipefail
+set -o errtrace
+set -o functrace
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -22,7 +28,7 @@ ARGS=$@
 #
 # Import common functions.
 #
-if [ "${IGNITE_HOME}" = "" ];
+if [ "${IGNITE_HOME:-}" = "" ];
     then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
     else IGNITE_HOME_TMP=${IGNITE_HOME};
 fi
@@ -66,7 +72,7 @@ JVM_OPTS="-Xms1g -Xmx1g -XX:MaxPermSize=128M -server ${JVM_OPTS}"
 # Mac OS specific support to display correct name in the dock.
 osname=`uname`
 
-if [ "${DOCK_OPTS}" == "" ]; then
+if [ "${DOCK_OPTS:-}" == "" ]; then
     DOCK_OPTS="-Xdock:name=Visor - Ignite Shell Console"
 fi
 
diff --git a/bin/include/parseargs.sh b/bin/include/parseargs.sh
index 759994d..3b4a070 100755
--- a/bin/include/parseargs.sh
+++ b/bin/include/parseargs.sh
@@ -40,7 +40,7 @@ set -o functrace
 # in other scripts to parse common command lines parameters.
 #
 
-CONFIG=${DEFAULT_CONFIG}
+CONFIG=${DEFAULT_CONFIG:-}
 INTERACTIVE="0"
 NOJMX="0"
 QUIET="-DIGNITE_QUIET=true"
diff --git a/modules/sqlline/bin/sqlline.sh b/modules/sqlline/bin/sqlline.sh
index 552440d..bfe1475 100644
--- a/modules/sqlline/bin/sqlline.sh
+++ b/modules/sqlline/bin/sqlline.sh
@@ -1,4 +1,10 @@
-#!/bin/bash
+#!/usr/bin/env bash
+set -o nounset
+set -o errexit
+set -o pipefail
+set -o errtrace
+set -o functrace
+
 #
 # Licensed to the Apache Software Foundation (ASF) under one or more
 # contributor license agreements.  See the NOTICE file distributed with
@@ -23,7 +29,7 @@
 #
 # Import common functions.
 #
-if [ "${IGNITE_HOME}" = "" ];
+if [ "${IGNITE_HOME:-}" = "" ];
     then IGNITE_HOME_TMP="$(dirname "$(cd "$(dirname "$0")"; "pwd")")";
     else IGNITE_HOME_TMP=${IGNITE_HOME};
 fi
@@ -50,10 +56,10 @@ setIgniteHome
 #
 . "${SCRIPTS_HOME}"/include/setenv.sh
 
-JDBCLINK="jdbc:ignite:thin://${HOST_AND_PORT}${SCHEMA_DELIMITER}${SCHEMA}${PARAMS}"
+JDBCLINK="jdbc:ignite:thin://${HOST_AND_PORT:-}${SCHEMA_DELIMITER:-}${SCHEMA:-}${PARAMS:-}"
 
 CP="${IGNITE_LIBS}"
 
 CP="${CP}${SEP}${IGNITE_HOME_TMP}/bin/include/sqlline/*"
 
-"$JAVA" -cp ${CP} sqlline.SqlLine -d org.apache.ignite.IgniteJdbcThinDriver $@
\ No newline at end of file
+"$JAVA" -cp ${CP} sqlline.SqlLine -d org.apache.ignite.IgniteJdbcThinDriver $@