Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions scripts/start-finalExec
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,17 @@ fi
canUseRollingLogs=true
useFallbackJvmFlag=false

if [[ ${FTB_DIR:-} ]]; then
SERVER_DIR="$FTB_DIR"
else
SERVER_DIR=/data
fi


patchLog4jConfig() {
file=${1?}
url=${2?}
if ! get -o "$file" "$url"; then
if ! get -o "${SERVER_DIR}/${file}" "$url"; then
log "ERROR: failed to download corrected log4j config, fallback to JVM flag"
useFallbackJvmFlag=true
return 1
Expand Down Expand Up @@ -94,14 +101,14 @@ if isTrue "${ENABLE_ROLLING_LOGS:-false}"; then
exit 1
fi
# Set up log configuration
LOGFILE="/data/log4j2.xml"
LOGFILE="${SERVER_DIR}/log4j2.xml"
if [ ! -e "$LOGFILE" ]; then
log "Creating log4j2.xml in ${LOGFILE}"
cp /image/log4j2.xml "$LOGFILE"
else
log "log4j2.xml already created, skipping"
fi
JVM_OPTS="-Dlog4j.configurationFile=/data/log4j2.xml ${JVM_OPTS}"
JVM_OPTS="-Dlog4j.configurationFile=log4j2.xml ${JVM_OPTS}"
fi

# Optional disable console
Expand Down