2015-05-28 11:32:57 +02:00
|
|
|
TOMCAT_USER={{ item.user }}
|
|
|
|
TOMCAT_GROUP={{ item.user }}
|
|
|
|
JAVA_HOME={{ item.java_home }}
|
|
|
|
JAVA_OPTS="-server -Djava.awt.headless=true"
|
2016-11-16 11:41:29 +01:00
|
|
|
{% if item.java_heap is defined %}
|
|
|
|
JAVA_HEAP="{{ item.java_heap }}"
|
|
|
|
{% else %}
|
|
|
|
JAVA_HEAP="{{ tomcat_m_java_opts_heap }}"
|
|
|
|
{% endif %}
|
2017-01-17 12:46:25 +01:00
|
|
|
JAVA_PERMGEN=
|
|
|
|
{% if jdk_default <= 7 %}
|
|
|
|
{% if item.java_permgen_size is defined %}
|
|
|
|
JAVA_PERMGEN="-XX:MaxPermSize={{ item.java_permgen_size }}"
|
|
|
|
{% else %}
|
|
|
|
JAVA_PERMGEN="-XX:MaxPermSize={{ tomcat_m_permgen_size }}"
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2015-05-28 11:32:57 +02:00
|
|
|
{% if item.java_opts is defined %}
|
2017-01-17 12:46:25 +01:00
|
|
|
JAVA_OPTS="{{ item.java_opts }} $JAVA_OPTS $JAVA_HEAP $JAVA_PERMGEN"
|
2015-05-28 11:32:57 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if item.java_gc_opts is defined %}
|
|
|
|
JAVA_OPTS="{{ item.java_gc_opts }} $JAVA_OPTS"
|
|
|
|
{% endif %}
|
|
|
|
{% if item.other_java_opts is defined %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} {{ item.other_java_opts }}"
|
|
|
|
{% endif %}
|
|
|
|
{% if item.jmx_enabled is defined and item.jmx_enabled %}
|
2016-11-17 14:49:06 +01:00
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port={{ item.jmx_port | default('tomcat_m_jmx_port') }}"
|
2015-06-15 18:54:51 +02:00
|
|
|
{% if item.jmx_use_ssl is defined and item.jmx_use_ssl %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=true"
|
|
|
|
{% else %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
|
|
|
|
{% endif %}
|
|
|
|
{% if item.jmx_localhost_only is defined and item.jmx_localhost_only %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.local.only=true"
|
|
|
|
{% endif %}
|
2015-05-28 11:32:57 +02:00
|
|
|
{% if item.jmx_auth_enabled is defined and item.jmx_auth_enabled %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.password.file={{ item.jmx_auth_dir }}/jmxremote.password -Dcom.sun.management.jmxremote.access.file={{ item.jmx_auth_dir }}/jmxremote.access"
|
|
|
|
{% else %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
|
|
|
|
{% endif %}
|
2015-06-15 18:54:51 +02:00
|
|
|
{% if item.jmx_disable_additional_ports is defined and item.jmx_disable_additional_ports %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -XX:+DisableAttachMechanism -Dcom.sun.management.jmxremote.rmi.port={{ item.jmx_port }}"
|
|
|
|
{% endif %}
|
|
|
|
|
2015-05-28 11:32:57 +02:00
|
|
|
{% endif %}
|
|
|
|
{% if item.remote_debugging is defined and item.remote_debugging %}
|
2015-06-15 18:54:51 +02:00
|
|
|
# You will be able to use a java debugger on port {{ item.remote_debugging_port }}.
|
2015-05-28 11:32:57 +02:00
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Xdebug -Xrunjdwp:transport=dt_socket,address={{ item.remote_debugging_port }},server=y,suspend=n"
|
|
|
|
{% endif %}
|
|
|
|
# WARNING: This directory will be destroyed and recreated at every startup !
|
|
|
|
JVM_TMP={{ item.instance_path }}/tmp
|
|
|
|
# Additional options not managed by the provisioning tools
|
|
|
|
if [ -f /etc/default/tomcat-instance-{{ item.http_port }}.local ] ; then
|
|
|
|
. /etc/default/tomcat-instance-{{ item.http_port }}.local
|
|
|
|
fi
|