From f44ed756df07b45ddc34201d5e569a4b8864772d Mon Sep 17 00:00:00 2001 From: Snile <826245622@qq.com> Date: Thu, 4 Feb 2021 14:23:16 +0800 Subject: [PATCH] Allow user-defined `JAVA_OPTS` in the startup script (#6316) --- CHANGES.md | 5 ++--- dist-material/bin/oapService.sh | 9 ++++----- dist-material/bin/oapServiceInit.sh | 9 ++++----- dist-material/bin/oapServiceNoInit.sh | 9 ++++----- dist-material/bin/webappService.sh | 9 ++++----- 5 files changed, 18 insertions(+), 23 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 313e7783b..ebdcfcec1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,12 +9,11 @@ Release Notes. #### Java Agent * Remove invalid mysql configuration in agent.config. -* Add net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener - to show detail message when redifine errors occur +* Add net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener to show detail message when redifine errors occur #### OAP-Backend - +* Allow user-defined `JAVA_OPTS` in the startup script. #### UI diff --git a/dist-material/bin/oapService.sh b/dist-material/bin/oapService.sh index 962691b88..b881ccb34 100644 --- a/dist-material/bin/oapService.sh +++ b/dist-material/bin/oapService.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env sh # 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 @@ -14,14 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env sh - PRG="$0" -PRGDIR=`dirname "$PRG"` -[ -z "$OAP_HOME" ] && OAP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +PRGDIR=$(dirname "$PRG") +[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd) OAP_LOG_DIR="${OAP_LOG_DIR:-${OAP_HOME}/logs}" -JAVA_OPTS=" -Xms256M -Xmx512M" +JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx512M}" if [ ! -d "${OAP_LOG_DIR}" ]; then mkdir -p "${OAP_LOG_DIR}" diff --git a/dist-material/bin/oapServiceInit.sh b/dist-material/bin/oapServiceInit.sh index 816c287e0..cd2db309f 100644 --- a/dist-material/bin/oapServiceInit.sh +++ b/dist-material/bin/oapServiceInit.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env sh # 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 @@ -14,14 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env sh - PRG="$0" -PRGDIR=`dirname "$PRG"` -[ -z "$OAP_HOME" ] && OAP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +PRGDIR=$(dirname "$PRG") +[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd) OAP_LOG_DIR="${OAP_HOME}/logs" -JAVA_OPTS=" -Xms256M -Xmx512M" +JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx512M}" if [ ! -d "${OAP_HOME}/logs" ]; then mkdir -p "${OAP_LOG_DIR}" diff --git a/dist-material/bin/oapServiceNoInit.sh b/dist-material/bin/oapServiceNoInit.sh index 5b80f72c3..42c54e609 100644 --- a/dist-material/bin/oapServiceNoInit.sh +++ b/dist-material/bin/oapServiceNoInit.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env sh # 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 @@ -14,14 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env sh - PRG="$0" -PRGDIR=`dirname "$PRG"` -[ -z "$OAP_HOME" ] && OAP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +PRGDIR=$(dirname "$PRG") +[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd) OAP_LOG_DIR=${OAP_LOG_DIR:-"${OAP_HOME}/logs"} -JAVA_OPTS=" -Xms256M -Xmx512M" +JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx512M}" if [ ! -d "${OAP_HOME}/logs" ]; then mkdir -p "${OAP_LOG_DIR}" diff --git a/dist-material/bin/webappService.sh b/dist-material/bin/webappService.sh index 890ea481b..dde778c57 100644 --- a/dist-material/bin/webappService.sh +++ b/dist-material/bin/webappService.sh @@ -1,3 +1,4 @@ +#!/usr/bin/env sh # 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 @@ -14,14 +15,12 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/usr/bin/env sh - PRG="$0" -PRGDIR=`dirname "$PRG"` -[ -z "$WEBAPP_HOME" ] && WEBAPP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` +PRGDIR=$(dirname "$PRG") +[ -z "$WEBAPP_HOME" ] && WEBAPP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd) WEBAPP_LOG_DIR="${WEBAPP_LOG_DIR:-${WEBAPP_HOME}/logs}" -JAVA_OPTS=" -Xms256M -Xmx512M" +JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx512M}" JAR_PATH="${WEBAPP_HOME}/webapp" if [ ! -d "${WEBAPP_LOG_DIR}" ]; then