diff --git a/tomcat-8.0-jsvc.service b/tomcat-8.0-jsvc.service index 413114b..8275796 100644 --- a/tomcat-8.0-jsvc.service +++ b/tomcat-8.0-jsvc.service @@ -12,7 +12,7 @@ After=syslog.target network.target [Service] Type=simple -EnvironmentFile=/etc/sysconfig/tomcat +EnvironmentFile=/etc/tomcat/tomcat.conf Environment="NAME=" "USE_JSVC=true" ExecStart=/usr/libexec/tomcat/server start ExecStop=/usr/libexec/tomcat/server stop diff --git a/tomcat-8.0.conf b/tomcat-8.0.conf index ad6e668..8550df7 100644 --- a/tomcat-8.0.conf +++ b/tomcat-8.0.conf @@ -1,22 +1,51 @@ -# System-wide configuration file for tomcat services. +# System-wide configuration file for tomcat services +# This will be loaded by systemd as an environment file, +# so please keep the syntax. # -# Use this file to change default values for all tomcat services. Change the -# service specific ones to affect only one service. For tomcat.service it is -# /etc/sysconfig/tomcat. For tomcat@instance it is /etc/sysconfig/tomcat@instance. -# -# This will not be sourced by systemd as an environment file. Feel free to add -# your overrides here. Shell invocations will work. +# There are 2 "classes" of startup behavior in this package. +# The old one, the default service named tomcat.service. +# The new named instances are called tomcat@instance.service. # +# Use this file to change default values for all services. +# Change the service specific ones to affect only one service. +# For tomcat.service it's /etc/sysconfig/tomcat, for +# tomcat@instance it's /etc/sysconfig/tomcat@instance. # This variable is used to figure out if config is loaded or not. -# To prevent this file to be loaded multiple times. TOMCAT_CFG_LOADED="1" +# In new-style instances, if CATALINA_BASE isn't specified, it will +# be constructed by joining TOMCATS_BASE and NAME. +TOMCATS_BASE="/var/lib/tomcats/" + +# Where your java installation lives +JAVA_HOME="/usr/lib/jvm/jre" + +# Where your tomcat installation lives +CATALINA_HOME="@@@TCHOME@@@" + +# System-wide tmp +CATALINA_TMPDIR="/var/cache/tomcat/temp" + +# You can pass some parameters to java here if you wish to +#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" + +# Use JAVA_OPTS to set java.library.path for libtcnative.so +#JAVA_OPTS="-Djava.library.path=/usr/lib" + +# Set default javax.sql.DataSource factory to apache commons one. See rhbz#1214381 +JAVA_OPTS="-Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory" + +# You can change your tomcat locale here +#LANG="en_US" + +# Run tomcat under the Java Security Manager +SECURITY_MANAGER="false" -if [ -z "${TOMCAT_SYSCONF_LOADED}" ]; then - if [ -z "${TOMCAT_SYSCONF}" ]; then - TOMCAT_SYSCONF="/etc/sysconfig/tomcat" - fi - . $TOMCAT_SYSCONF -fi +# Time to wait in seconds, before killing process +# TODO(stingray): does nothing, fix. +# SHUTDOWN_WAIT="30" +# If you wish to further customize your tomcat environment, +# put your own definitions here +# (i.e. LD_LIBRARY_PATH for some jdbc drivers) diff --git a/tomcat-8.0.service b/tomcat-8.0.service index 157e7e1..103d464 100644 --- a/tomcat-8.0.service +++ b/tomcat-8.0.service @@ -9,8 +9,9 @@ After=syslog.target network.target [Service] Type=simple +EnvironmentFile=/etc/tomcat/tomcat.conf Environment="NAME=" -EnvironmentFile=/etc/sysconfig/tomcat +EnvironmentFile=-/etc/sysconfig/tomcat ExecStart=/usr/libexec/tomcat/server start ExecStop=/usr/libexec/tomcat/server stop SuccessExitStatus=143 diff --git a/tomcat-8.0.sysconfig b/tomcat-8.0.sysconfig index d918420..3117bf7 100644 --- a/tomcat-8.0.sysconfig +++ b/tomcat-8.0.sysconfig @@ -1,48 +1,11 @@ -# Service-specific configuration file for tomcat services. This will be sourced by -# systemd for the default service (tomcat.service). -# +# Service-specific configuration file for tomcat. This will be sourced by +# systemd for the default service (tomcat.service) # If you want to customize named instance, make a similar file # and name it tomcat@instancename. -# -# This will be loaded by systemd as an environment file, so please keep -# the syntax. If you need to use shell expansion, configure the necessary -# variables in /etc/tomcat/tomcat.conf. -# This variable is used to figure out if this config is loaded or not. -TOMCAT_SYSCONF_LOADED="1" +# You will not need to set this, usually. For default service it equals +# CATALINA_HOME. For named service, it equals ${TOMCATS_BASE}${NAME} +#CATALINA_BASE="@@@TCHOME@@@" -# In new-style instances, if CATALINA_BASE isn't specified, it will -# be constructed by joining TOMCATS_BASE and NAME. -TOMCATS_BASE="/var/lib/tomcats/" - -# Where your java installation lives -JAVA_HOME="/usr/lib/jvm/jre" - -# Where your tomcat installation lives -CATALINA_HOME="@@@TCHOME@@@" - -# System-wide tmp -CATALINA_TMPDIR="/var/cache/tomcat/temp" - -# You can pass some parameters to java here if you wish to -#JAVA_OPTS="-Xminf0.1 -Xmaxf0.3" - -# Use JAVA_OPTS to set java.library.path for libtcnative.so -#JAVA_OPTS="-Djava.library.path=/usr/lib" - -# Set default javax.sql.DataSource factory to apache commons one. See rhbz#1214381 -JAVA_OPTS="-Djavax.sql.DataSource.Factory=org.apache.commons.dbcp.BasicDataSourceFactory" - -# You can change your tomcat locale here -#LANG="en_US" - -# Run tomcat under the Java Security Manager -SECURITY_MANAGER="false" - -# Time to wait in seconds, before killing process -# TODO(stingray): does nothing, fix. -# SHUTDOWN_WAIT="30" - -# If you wish to further customize your tomcat environment, -# put your own definitions here -# (i.e. LD_LIBRARY_PATH for some jdbc drivers) +# Please take a look at /etc/tomcat/tomcat.conf to have an idea what you +# can override. diff --git a/tomcat-named.service b/tomcat-named.service index bb89293..9bbcb17 100644 --- a/tomcat-named.service +++ b/tomcat-named.service @@ -12,7 +12,7 @@ After=syslog.target network.target [Service] Type=simple -EnvironmentFile=/etc/sysconfig/tomcat +EnvironmentFile=/etc/tomcat/tomcat.conf Environment="NAME=%I" EnvironmentFile=-/etc/sysconfig/tomcat@%I ExecStart=/usr/libexec/tomcat/server start