99#
1010STASH_HOME="<%= node['stash']['home_path'] %> "
1111
12+ #
13+ # Native libraries, such as the Tomcat native library, can be placed here for use by Stash. Alternatively, native
14+ # libraries can also be placed in $STASH_HOME/lib/native, where they will also be included in the library path used
15+ # by the JVM. By placing libraries in $STASH_HOME, they can be preserved across Stash upgrades.
16+ #
17+ # NOTE: You must choose the library architecture, x86 or x64, based on the JVM you'll be running, _not_ based on the OS.
18+ #
19+ JVM_LIBRARY_PATH="$CATALINA_HOME/lib/native:$STASH_HOME/lib/native"
20+
1221#
1322# Occasionally Atlassian Support may recommend that you set some specific JVM arguments. You can use this variable
1423# below to do that.
15- #
24+
1625JVM_SUPPORT_RECOMMENDED_ARGS="<%= node['stash']['jvm']['support_args'] %> "
1726
1827#
@@ -30,7 +39,7 @@ JVM_FILE_ENCODING="UTF-8"
3039#
3140# The following are the required arguments needed for Atlassian Stash.
3241#
33- JVM_REQUIRED_ARGS="-Djava.awt.headless=true -Dfile.encoding=${JVM_FILE_ENCODING} -Datlassian.standalone=STASH -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false"
42+ JVM_REQUIRED_ARGS="-Djava.awt.headless=true -Dfile.encoding=${JVM_FILE_ENCODING} -Datlassian.standalone=STASH -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -Dmail.mime.decodeparameters=true -Dorg.apache.catalina.connector.Response.ENFORCE_ENCODING_IN_GET_WRITER=false"
3443
3544#
3645# Additional JVM arguments
7079
7180STASH_HOME_MINUSD=-Dstash.home=$STASH_HOME
7281
82+ if [ "$JVM_LIBRARY_PATH" != "" ]; then
83+ JVM_LIBRARY_PATH_MINUSD=-Djava.library.path=$JVM_LIBRARY_PATH
84+ JVM_REQUIRED_ARGS="${JVM_REQUIRED_ARGS} ${JVM_LIBRARY_PATH_MINUSD}"
85+ fi
86+
7387JAVA_OPTS="-Xms${JVM_MINIMUM_MEMORY} -Xmx${JVM_MAXIMUM_MEMORY} ${JAVA_OPTS} ${JVM_REQUIRED_ARGS} ${JVM_SUPPORT_RECOMMENDED_ARGS} ${STASH_HOME_MINUSD}"
7488
7589# PermGen size needs to be increased if encountering OutOfMemoryError: PermGen problems. Specifying PermGen size is
0 commit comments