ansible-role-tomcat-multipl.../templates/tomcat-start.sh.j2

30 lines
813 B
Plaintext
Raw Normal View History

2024-07-31 19:12:46 +02:00
#!/bin/sh
#
# Startup script for Apache Tomcat with systemd
#
set -e
# Load the service settings
. /etc/default/tomcat-instance-{{ item.http_port }}
2024-08-02 14:17:58 +02:00
# We set JAVA_HOME in /etc/default/tomcat-instance-{{ item.http_port }}
# . /usr/libexec/tomcat{{ tomcat_version }}/tomcat-locate-java.sh
2024-07-31 19:12:46 +02:00
# Set the JSP compiler if configured in the /etc/default/tomcat10 file
[ -n "$JSP_COMPILER" ] && JAVA_OPTS="$JAVA_OPTS -Dbuild.compiler=\"$JSP_COMPILER\""
export JAVA_OPTS
# Enable the Java security manager?
SECURITY=""
[ "$SECURITY_MANAGER" = "true" ] && SECURITY="-security"
# Start Tomcat
{% if ansible_distribution_version is version_compare('22.04', '<') %}
cd $CATALINA_BASE && exec $CATALINA_HOME/bin/catalina.sh run
{% else %}
2024-07-31 19:12:46 +02:00
cd $CATALINA_BASE && exec $CATALINA_HOME/bin/catalina.sh run $SECURITY
{% endif %}