File tree Expand file tree Collapse file tree 1 file changed +16
-12
lines changed
Expand file tree Collapse file tree 1 file changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -4,16 +4,15 @@ set -euo pipefail
44cd " $( dirname " $0 " ) /.." || exit 1
55rm -f deploy/shutdown.xml
66
7- # Initialize arrays
87JAVA_OPTS=()
9- OTHER_OPTS =()
8+ APP_OPTS =()
109
1110PID_FILE=" jpos.pid"
1211USE_PID=true
1312
1413for arg in " $@ " ; do
1514 case " $arg " in
16- -D* )
15+ -D* |-X * |-agentlib: * |-javaagent: * |--add-opens= * |--add-exports= * |--enable-native-access= * |--sun-misc-unsafe-memory-access= * )
1716 JAVA_OPTS+=(" $arg " )
1817 ;;
1918 --pid=* )
@@ -26,7 +25,7 @@ for arg in "$@"; do
2625 JAVA_OPTS+=(" -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" )
2726 ;;
2827 * )
29- OTHER_OPTS +=(" $arg " )
28+ APP_OPTS +=(" $arg " )
3029 ;;
3130 esac
3231done
4140
4241mkdir -p log
4342
44- # Base JVM invocation
4543CMD=(
46- java -server
44+ java
45+ -server
4746 -Xmx4G
4847 --enable-native-access=ALL-UNNAMED
4948 --sun-misc-unsafe-memory-access=allow
5049 -Xlog:gc:log/gc.log
51- -jar @jarname@
5250)
5351
54- # Only pass --pid if enabled
52+ CMD+=( ${JAVA_OPTS[@]+" ${JAVA_OPTS[@]} " } )
53+
54+ CMD+=(
55+ -jar
56+ @jarname@
57+ )
58+
5559if $USE_PID ; then
56- CMD+=( --pid=" $PID_FILE " )
60+ CMD+=( " --pid=$PID_FILE " )
5761fi
5862
59- # Append opts (nounset-safe)
60- CMD+=( ${JAVA_OPTS[@]+" ${JAVA_OPTS[@]} " } )
61- CMD+=( ${OTHER_OPTS[@]+" ${OTHER_OPTS[@]} " } )
63+ CMD+=( ${APP_OPTS[@]+" ${APP_OPTS[@]} " } )
6264
65+ # printf '%q ' "${CMD[@]}"
66+ # echo
6367exec " ${CMD[@]} "
6468
You can’t perform that action at this time.
0 commit comments