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 %}
|
2017-01-17 12:54:01 +01:00
|
|
|
# JMX settings
|
2017-09-21 18:40:37 +02:00
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port={{ item.jmx_port | default('8186') }}"
|
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 %}
|
2018-01-23 19:38:44 +01:00
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Dcom.sun.management.jmxremote.local.only=true -Djava.rmi.server.hostname=127.0.0.1"
|
|
|
|
{% else %}
|
|
|
|
JAVA_OPTS="${JAVA_OPTS} -Djava.rmi.server.hostname={{ tomcat_m_jmx_ip_address }}"
|
2015-06-15 18:54:51 +02:00
|
|
|
{% 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 }}.
|
2017-10-17 20:14:09 +02:00
|
|
|
JAVA_OPTS="${JAVA_OPTS} -agentlib:jdwp=transport=dt_socket,address={{ item.remote_debugging_port }},server=y,suspend=n"
|
2015-05-28 11:32:57 +02:00
|
|
|
{% endif %}
|
|
|
|
# WARNING: This directory will be destroyed and recreated at every startup !
|
|
|
|
JVM_TMP={{ item.instance_path }}/tmp
|
2017-09-15 12:44:48 +02:00
|
|
|
{% if item.catalina_tmp_directory is defined %}
|
|
|
|
export CATALINA_TMPDIR={{ item.catalina_tmp_directory }}
|
|
|
|
{% endif %}
|
2015-05-28 11:32:57 +02:00
|
|
|
# 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
|