-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dotcmsbuild
committed
Jan 31, 2023
1 parent
6590a84
commit f4dcc83
Showing
8 changed files
with
305 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
@echo off | ||
rem Licensed to the Apache Software Foundation (ASF) under one or more | ||
rem contributor license agreements. See the NOTICE file distributed with | ||
rem this work for additional information regarding copyright ownership. | ||
rem The ASF licenses this file to You under the Apache License, Version 2.0 | ||
rem (the "License"); you may not use this file except in compliance with | ||
rem the License. You may obtain a copy of the License at | ||
rem | ||
rem http://www.apache.org/licenses/LICENSE-2.0 | ||
rem | ||
rem Unless required by applicable law or agreed to in writing, software | ||
rem distributed under the License is distributed on an "AS IS" BASIS, | ||
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
rem See the License for the specific language governing permissions and | ||
rem limitations under the License. | ||
|
||
rem --------------------------------------------------------------------------- | ||
rem Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings | ||
rem are valid and consistent with the selected start-up options and set up the | ||
rem endorsed directory. | ||
rem --------------------------------------------------------------------------- | ||
|
||
rem Make sure prerequisite environment variables are set | ||
|
||
rem In debug mode we need a real JDK (JAVA_HOME) | ||
if ""%1"" == ""debug"" goto needJavaHome | ||
|
||
rem Otherwise either JRE or JDK are fine | ||
if not "%JRE_HOME%" == "" goto gotJreHome | ||
if not "%JAVA_HOME%" == "" goto gotJavaHome | ||
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined | ||
echo At least one of these environment variable is needed to run this program | ||
goto exit | ||
|
||
:needJavaHome | ||
rem Check if we have a usable JDK | ||
if "%JAVA_HOME%" == "" goto noJavaHome | ||
if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome | ||
if not exist "%JAVA_HOME%\bin\jdb.exe" goto noJavaHome | ||
if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome | ||
set "JRE_HOME=%JAVA_HOME%" | ||
goto okJava | ||
|
||
:noJavaHome | ||
echo The JAVA_HOME environment variable is not defined correctly. | ||
echo It is needed to run this program in debug mode. | ||
echo NB: JAVA_HOME should point to a JDK not a JRE. | ||
goto exit | ||
|
||
:gotJavaHome | ||
rem No JRE given, use JAVA_HOME as JRE_HOME | ||
set "JRE_HOME=%JAVA_HOME%" | ||
|
||
:gotJreHome | ||
rem Check if we have a usable JRE | ||
if not exist "%JRE_HOME%\bin\java.exe" goto noJreHome | ||
goto okJava | ||
|
||
:noJreHome | ||
rem Needed at least a JRE | ||
echo The JRE_HOME environment variable is not defined correctly | ||
echo This environment variable is needed to run this program | ||
goto exit | ||
|
||
:okJava | ||
rem Don't override the endorsed dir if the user has set it previously | ||
if not "%JAVA_ENDORSED_DIRS%" == "" goto gotEndorseddir | ||
rem Java 9 no longer supports the java.endorsed.dirs | ||
rem system property. Only try to use it if | ||
rem CATALINA_HOME/endorsed exists. | ||
if not exist "%CATALINA_HOME%\endorsed" goto gotEndorseddir | ||
set "JAVA_ENDORSED_DIRS=%CATALINA_HOME%\endorsed" | ||
:gotEndorseddir | ||
|
||
rem Don't override _RUNJAVA if the user has set it previously | ||
if not "%_RUNJAVA%" == "" goto gotRunJava | ||
rem Set standard command for invoking Java. | ||
rem Also note the quoting as JRE_HOME may contain spaces. | ||
set _RUNJAVA="%JRE_HOME%\bin\java.exe" | ||
:gotRunJava | ||
|
||
rem Don't override _RUNJDB if the user has set it previously | ||
rem Also note the quoting as JAVA_HOME may contain spaces. | ||
if not "%_RUNJDB%" == "" goto gotRunJdb | ||
set _RUNJDB="%JAVA_HOME%\bin\jdb.exe" | ||
:gotRunJdb | ||
|
||
if not "%USE_GLOBAL_LOG4J" == "" goto gotGlobalLog4j | ||
if [ "$USE_GLOBAL_LOG4J" = true ]; then | ||
echo Using Global Log4j | ||
set CLASSPATH="%CATALINA_HOME%\log4j2\lib\*;%CATALINA_HOME%\log4j2\conf$CLASSPATH" | ||
set JAVA_OPTS=" -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector %JAVA_OPTS%" | ||
set JAVA_OPTS=" -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager %JAVA_OPTS%" | ||
fi | ||
:gotGlobalLog4j | ||
|
||
|
||
goto end | ||
|
||
:exit | ||
exit /b 1 | ||
|
||
:end | ||
exit /b 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
#!/bin/sh | ||
|
||
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# ----------------------------------------------------------------------------- | ||
# Set JAVA_HOME or JRE_HOME if not already set, ensure any provided settings | ||
# are valid and consistent with the selected start-up options and set up the | ||
# endorsed directory. | ||
# ----------------------------------------------------------------------------- | ||
|
||
# Make sure prerequisite environment variables are set | ||
if [ -z "$JAVA_HOME" ] && [ -z "$JRE_HOME" ]; then | ||
if $darwin; then | ||
# Bugzilla 54390 | ||
if [ -x '/usr/libexec/java_home' ] ; then | ||
export JAVA_HOME=`/usr/libexec/java_home` | ||
# Bugzilla 37284 (reviewed). | ||
elif [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" ]; then | ||
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home" | ||
fi | ||
else | ||
JAVA_PATH=`which java 2>/dev/null` | ||
if [ "x$JAVA_PATH" != "x" ]; then | ||
JAVA_PATH=`dirname "$JAVA_PATH" 2>/dev/null` | ||
JRE_HOME=`dirname "$JAVA_PATH" 2>/dev/null` | ||
fi | ||
if [ "x$JRE_HOME" = "x" ]; then | ||
# XXX: Should we try other locations? | ||
if [ -x /usr/bin/java ]; then | ||
JRE_HOME=/usr | ||
fi | ||
fi | ||
fi | ||
if [ -z "$JAVA_HOME" ] && [ -z "$JRE_HOME" ]; then | ||
echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" | ||
echo "At least one of these environment variable is needed to run this program" | ||
exit 1 | ||
fi | ||
fi | ||
if [ -z "$JAVA_HOME" ] && [ "$1" = "debug" ]; then | ||
echo "JAVA_HOME should point to a JDK in order to run in debug mode." | ||
exit 1 | ||
fi | ||
if [ -z "$JRE_HOME" ]; then | ||
JRE_HOME="$JAVA_HOME" | ||
fi | ||
|
||
# If we're running under jdb, we need a full jdk. | ||
if [ "$1" = "debug" ] ; then | ||
if [ "$os400" = "true" ]; then | ||
if [ ! -x "$JAVA_HOME"/bin/java ] || [ ! -x "$JAVA_HOME"/bin/javac ]; then | ||
echo "The JAVA_HOME environment variable is not defined correctly" | ||
echo "This environment variable is needed to run this program" | ||
echo "NB: JAVA_HOME should point to a JDK not a JRE" | ||
exit 1 | ||
fi | ||
else | ||
if [ ! -x "$JAVA_HOME"/bin/java ] || [ ! -x "$JAVA_HOME"/bin/jdb ] || [ ! -x "$JAVA_HOME"/bin/javac ]; then | ||
echo "The JAVA_HOME environment variable is not defined correctly" | ||
echo "This environment variable is needed to run this program" | ||
echo "NB: JAVA_HOME should point to a JDK not a JRE" | ||
exit 1 | ||
fi | ||
fi | ||
fi | ||
|
||
# Don't override the endorsed dir if the user has set it previously | ||
if [ -z "$JAVA_ENDORSED_DIRS" ]; then | ||
# Java 9 no longer supports the java.endorsed.dirs | ||
# system property. Only try to use it if | ||
# CATALINA_HOME/endorsed exists. | ||
if [ -d "$CATALINA_HOME"/endorsed ]; then | ||
JAVA_ENDORSED_DIRS="$CATALINA_HOME"/endorsed | ||
fi | ||
fi | ||
|
||
# Set standard commands for invoking Java, if not already set. | ||
if [ -z "$_RUNJAVA" ]; then | ||
_RUNJAVA="$JRE_HOME"/bin/java | ||
fi | ||
if [ "$os400" != "true" ]; then | ||
if [ -z "$_RUNJDB" ]; then | ||
_RUNJDB="$JAVA_HOME"/bin/jdb | ||
fi | ||
fi | ||
echo In set classpath | ||
if [ "$USE_GLOBAL_LOG4J" = true ]; then | ||
echo Using Global Log4j | ||
CLASSPATH="$CATALINA_HOME/log4j2/lib/*:$CATALINA_HOME/log4j2/conf$CLASSPATH" | ||
JAVA_OPTS=" -DLog4jContextSelector=org.apache.logging.log4j.core.async.BasicAsyncLoggerContextSelector $JAVA_OPTS" | ||
JAVA_OPTS=" -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager $JAVA_OPTS" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- ================================================ --> | ||
<!-- Tomcat log4j2 logger --> | ||
<!-- ================================================ --> | ||
<Configuration status="INFO" monitorInterval="60"> | ||
<Properties> | ||
<Property name="logsdir">${sys:catalina.base}/logs</Property> | ||
<Property name="layout">%d %highlight{[%-6p]} [%t] %c{1.} - %m%n</Property> | ||
</Properties> | ||
<Appenders> | ||
<Console name="DEFAULT" target="SYSTEM_OUT"> | ||
<PatternLayout pattern="${layout}"/> | ||
</Console> | ||
<!-- | ||
<RollingFile name="FILE" | ||
fileName="${logsdir}/worker.log" | ||
filePattern="${logsdir}/catalina.%d{yyyy-MM-dd}-%i.log" immediateFlush="false"> | ||
<PatternLayout pattern="${layout}"/> | ||
<Policies> | ||
<TimeBasedTriggeringPolicy/> | ||
<SizeBasedTriggeringPolicy size="10 MB"/> | ||
</Policies> | ||
<DefaultRolloverStrategy max="100"/> | ||
</RollingFile> | ||
--> | ||
</Appenders> | ||
<Loggers> | ||
|
||
<Root level="INFO" includeLocation="true"> | ||
<AppenderRef ref="DEFAULT"/> | ||
</Root> | ||
|
||
<logger name="org.apache.catalina" level="INFO"/> | ||
<logger name="org.apache.catalina.core" level="INFO"/> | ||
<logger name="org.apache.tomcat" level="INFO"/> | ||
<logger name="org.apache.coyote" level="INFO"/> | ||
<logger name="org.apache.jasper" level="INFO"/> | ||
|
||
|
||
</Loggers> | ||
</Configuration> |