Project

General

Profile

« Previous | Next » 

Revision 37307457

Added by François ARMAND over 6 years ago

Fixes #11647: Upgrade to Jetty9

View differences:

rudder-inventory-endpoint/SPECS/rudder-inventory-endpoint.spec
# Post Installation
#=================================================
# Create a symlink to the Jetty context if necessary
if [ -d "%{rudderdir}/jetty7/contexts" ]; then
ln -sf %{rudderdir}/share/webapps/endpoint.xml %{rudderdir}/jetty7/contexts/endpoint.xml
fi
# Run any upgrades
echo "INFO: Launching script to check if a migration is needed"
%{rudderdir}/bin/rudder-inventory-endpoint-upgrade
rudder-inventory-endpoint/debian/postinst
case "$1" in
configure)
# Create a symlink to the Jetty context if necessary
if [ -d "/opt/rudder/jetty7/contexts" ]; then
ln -sf /opt/rudder/share/webapps/endpoint.xml /opt/rudder/jetty7/contexts/endpoint.xml
fi
# Run any upgrades
echo "INFO: Launching script to check if a migration is needed"
/opt/rudder/bin/rudder-inventory-endpoint-upgrade
rudder-jetty/SOURCES/Makefile
.DEFAULT_GOAL := localdepends
JETTY_RELEASE = 7.6.21
DATE_RELEASE = 20160908
JETTY_RELEASE = 9.4.7
DATE_RELEASE = 20170914
TMP_DIR := $(shell mktemp -dq)
WGET := $(if $(PROXY), http_proxy=$(PROXY) ftp_proxy=$(PROXY)) /usr/bin/wget -q
FIND := /usr/bin/find
# this is the orginal URL for Jetty distribution
JETTY_URL := "http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/$(JETTY_RELEASE).v$(DATE_RELEASE)/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE).tar.gz"
# this is our "local" copy, used to make reproducible build whatever happen to original URL
JETTY_NRM_URL := "http://www.normation.com/tarball/jetty/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE).tar.gz"
localdepends: ./jetty7
localdepends: ./jetty
rm -rf $(TMP_DIR)
./jetty7: /usr/bin/wget
./jetty: /usr/bin/wget
# Download and uncompress the Jetty distribution
# Original URL: http://repo1.maven.org/maven2/org/eclipse/jetty/jetty-distribution/$(JETTY_RELEASE).v$(DATE_RELEASE)/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE).tar.gz
$(WGET) -O $(TMP_DIR)/jetty.tgz http://www.normation.com/tarball/jetty/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE).tar.gz
$(WGET) -O $(TMP_DIR)/jetty.tgz $(JETTY_NRM_URL)
tar xzf $(TMP_DIR)/jetty.tgz -C $(TMP_DIR)
mv $(TMP_DIR)/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE) ./jetty7
mv $(TMP_DIR)/jetty-distribution-$(JETTY_RELEASE).v$(DATE_RELEASE) ./jetty
rm -rf $(TMP_DIR)
# Remove useless / demo elements from Jetty
rm -rf ./jetty7/javadoc
rm -rf ./jetty7/webapps/*
rm -rf ./jetty7/contexts/*
touch ./jetty7/webapps/.donotdelete
# Change default log directory for jetty
sed -i 's/default=\".\/logs\"/default=\"\/var\/log\/rudder\/webapp\"/g' ./jetty7/etc/jetty-logging.xml
# Change jetty's default settings to listen on localhost only
sed -i 's/\(<Set\ name=\"host\"><Property\ name=\"jetty.host\"\ \)\(\/>\)/\1default="127.0.0.1"\2/g' ./jetty7/etc/jetty.xml
# Set jetty requestHeaderSize if not yet modified
grep 'Set name="requestHeaderSize"' ./jetty7/etc/jetty.xml >/dev/null || sed -i -e '/<New class="org.eclipse.jetty.server.nio.SelectChannelConnector">/s/$$/\n <Set name="requestHeaderSize">8192<\/Set>/' ./jetty7/etc/jetty.xml
# jetty9 is clean now - only demo-base
rm -rf ./jetty/demo-base
# Change jetty.sh before distincts files
patch -p0 -s < patches/jetty/jetty-init-umask.patch
......
patch -p0 -s < patches/jetty/jetty-init-redirect-stderrout.patch
patch -p0 -s < patches/jetty/jetty-init-stop-forcestop.patch
cp ./jetty7/bin/jetty.sh ./jetty7/bin/jetty-debian.sh
cp ./jetty7/bin/jetty.sh ./jetty7/bin/jetty-rpm.sh
cp ./jetty/bin/jetty.sh ./jetty/bin/jetty-debian.sh
cp ./jetty/bin/jetty.sh ./jetty/bin/jetty-rpm.sh
patch -p0 -s < patches/jetty/jetty-init-lsb-fix-debian.patch
patch -p0 -s < patches/jetty/jetty-init-lsb-fix-rpm.patch
patch -p0 -s < patches/jetty/jetty-init-softokn-version-check.patch
cp ./jetty7/bin/jetty-rpm.sh ./jetty7/bin/jetty-sles.sh
cp ./jetty/bin/jetty-rpm.sh ./jetty/bin/jetty-sles.sh
patch -p0 -s < patches/jetty/jetty-init-sles.patch
patch -p0 -s < patches/jetty/jetty-init-ulimit.patch
# Provide jetty's init script to the debian package's standard location
cp ./jetty7/bin/jetty-debian.sh ../debian/rudder-jetty.init
cp ./jetty/bin/jetty-debian.sh ../debian/rudder-jetty.init
cp ./rudder-jetty.default ../debian/rudder-jetty.default
chmod +x ../debian/rudder-jetty.init
......
sudo aptitude --assume-yes install wget
localclean:
rm -rf ./jetty7
rm -rf ./jetty
rm -f ../debian/rudder-jetty.init
rm -f ../debian/rudder-jetty.default
rm -rf $(TMP_DIR)
rudder-jetty/SOURCES/patches/jetty/jetty-init-lsb-fix-debian.patch
--- jetty7/bin/jetty-debian.sh 2010-12-06 19:26:42.000000000 +0100
+++ jetty7/bin/jetty-debian.sh 2011-07-27 17:39:27.866582165 +0200
--- jetty/bin/jetty-debian.sh 2010-12-06 19:26:42.000000000 +0100
+++ jetty/bin/jetty-debian.sh 2011-07-27 17:39:27.866582165 +0200
@@ -9,6 +9,16 @@
# processname: jetty
# ========================
rudder-jetty/SOURCES/patches/jetty/jetty-init-lsb-fix-rpm.patch
--- jetty7/bin/jetty-rpm.sh 2010-12-06 19:26:42.000000000 +0100
+++ jetty7/bin/jetty-rpm.sh 2011-07-27 17:39:27.866582165 +0200
--- jetty/bin/jetty-rpm.sh 2010-12-06 19:26:42.000000000 +0100
+++ jetty/bin/jetty-rpm.sh 2011-07-27 17:39:27.866582165 +0200
@@ -9,6 +9,20 @@
# processname: jetty
# ========================
rudder-jetty/SOURCES/patches/jetty/jetty-init-prevent-false-failed-starts.patch
--- jetty7/bin/jetty.sh 2015-03-31 12:08:37.319515629 +0200
+++ jetty7/bin/jetty.sh 2015-03-31 12:12:16.660886179 +0200
@@ -117,10 +117,10 @@
--- jetty/bin/jetty.sh 2017-10-20 21:09:54.213736038 +0200
+++ jetty/bin/jetty.sh_5 2017-10-20 21:18:07.960397445 +0200
@@ -133,10 +133,10 @@
do
sleep 4
[ -z "$(grep STARTED $1 2>/dev/null)" ] || return 0
......
echo -n ". "
done
@@ -358,8 +358,8 @@
then
JETTY_STATE=$JETTY_HOME/jetty.state
fi
+
JAVA_OPTIONS+=("-Djetty.state=$JETTY_STATE")
-rm -f $JETTY_STATE
##################################################
# Set default JVM parameters, to be
@@ -487,7 +487,15 @@
@@ -469,6 +469,14 @@
exit
fi
- if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1
+ if [ $(${PS_COMMAND} | grep -cE "[j]ava .* /opt/rudder/jetty7/start.jar") -ne 0 ]
+ if [ $(${PS_COMMAND} | grep -cE "[j]ava .* /opt/rudder/jetty/start.jar") -ne 0 ]
+ then
+ echo "already running."
+ exit 0
......
+
+ rm -f ${JETTY_STATE}
+
+ if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1
if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1
then
unset CH_USER
if [ -n "$JETTY_USER" ]
@@ -561,7 +569,9 @@
sleep 1
done
+ rm -f ${JETTY_STATE}
rm -f "$JETTY_PID"
+
echo OK
else
PID=$(cat "$JETTY_PID" 2>/dev/null)
@@ -580,7 +590,9 @@
sleep 1
done
+ rm -f ${JETTY_STATE}
rm -f "$JETTY_PID"
+
echo OK
fi
rudder-jetty/SOURCES/patches/jetty/jetty-init-redirect-stderrout.patch
--- jetty7/bin/jetty.sh 2015-11-27 11:58:56.712592963 +0100
+++ jetty7/bin/jetty.sh 2015-11-27 12:33:15.360577776 +0100
@@ -503,11 +503,11 @@
--- jetty/bin/jetty.sh 2017-10-20 21:18:40.570397097 +0200
+++ jetty/bin/jetty.sh_6 2017-10-20 21:31:56.110388623 +0200
@@ -313,6 +313,7 @@
#####################################################
# define start log location
#####################################################
+JETTY_START_LOG="/var/log/rudder/webapp/java.log"
if [ -z "$JETTY_START_LOG" ]
then
JETTY_START_LOG="$JETTY_RUN/$NAME-start.log"
@@ -507,11 +508,11 @@
chown "$JETTY_USER" "$JETTY_PID"
# FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc.
su - "$JETTY_USER" -c "
- exec ${RUN_CMD[*]} --daemon &
+ exec ${RUN_CMD[*]} --daemon >${JETTY_LOGS}/java.log 2>&1 &
su - "$JETTY_USER" $SU_SHELL -c "
- exec ${RUN_CMD[*]} start-log-file="$JETTY_START_LOG" > /dev/null &
+ exec ${RUN_CMD[*]} start-log-file="$JETTY_START_LOG" >${JETTY_START_LOG} 2>&1 &
disown \$!
echo \$! > '$JETTY_PID'"
else
- "${RUN_CMD[@]}" &
+ "${RUN_CMD[@]}" >${JETTY_LOGS}/java.log 2>&1 &
- "${RUN_CMD[@]}" > /dev/null &
+ "${RUN_CMD[@]}" >${JETTY_START_LOG} 2>&1 &
disown $!
echo $! > "$JETTY_PID"
fi
rudder-jetty/SOURCES/patches/jetty/jetty-init-sizecheck.patch
--- jetty7/bin/jetty.sh.orig 2014-03-13 01:12:07.659327820 +0100
+++ jetty7/bin/jetty.sh 2014-03-13 01:10:00.507714504 +0100
@@ -134,6 +134,18 @@
diff --git jetty/bin/jetty.sh.orig jetty/bin/jetty.sh
index d41079d..cf99294 100755
--- jetty/bin/jetty.sh.orig
+++ jetty/bin/jetty.sh
@@ -150,9 +150,24 @@ readConfig()
source "$1"
}
......
+ echo "WARNING: Not enough free memory to start Jetty (about ${TOTAL_MEM_NEEDED}MB are needed). Trying anyway, but the application is likely to fail."
+ fi
+}
+
dumpEnv()
{
echo "JAVA = $JAVA"
+ echo "JAVA_XMX = ${JAVA_XMX}"
+ echo "JAVA_MAXPERMSIZE = ${JAVA_MAXPERMSIZE}"
echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
echo "JETTY_HOME = $JETTY_HOME"
echo "JETTY_BASE = $JETTY_BASE"
@@ -356,6 +371,13 @@ then
done < "$JETTY_CONF"
fi
##################################################
@@ -351,6 +363,13 @@
rm -f $JETTY_STATE
##################################################
+##################################################
+# Set default JVM parameters, to be
+# overriden by the configuration file
+##################################################
+JAVA_XMX=${JAVA_XMX:-1024}
+JAVA_MAXPERMSIZE=${JAVA_MAXPERMSIZE:-256}
+
+##################################################
##################################################
# Setup JAVA if unset
##################################################
if [ -z "$JAVA" ]
@@ -421,6 +440,8 @@
echo "JETTY_PID = $JETTY_PID"
echo "JETTY_ARGS = $JETTY_ARGS"
echo "CONFIGS = ${CONFIGS[*]}"
+ echo "JAVA_XMX = ${JAVA_XMX}"
+ echo "JAVA_MAXPERMSIZE = ${JAVA_MAXPERMSIZE}"
echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
echo "JAVA = $JAVA"
echo "RUN_CMD = ${RUN_CMD}"
@@ -433,6 +454,10 @@
@@ -437,6 +459,10 @@ case "$ACTION" in
start)
UMASK="0027"
UMASK="0007"
echo "Setting umask to ${UMASK}"
+
+ # Checking if enough RAM is available for Jetty to use
......
+
echo -n "Starting Jetty: "
if (( NO_START )); then
@@ -583,6 +608,8 @@
echo "JETTY_LOGS = $JETTY_LOGS"
echo "START_INI = $START_INI"
echo "CONFIGS = ${CONFIGS[*]}"
+ echo "JAVA_XMX = ${JAVA_XMX}"
+ echo "JAVA_MAXPERMSIZE = ${JAVA_MAXPERMSIZE}"
echo "JAVA_OPTIONS = ${JAVA_OPTIONS[*]}"
echo "JAVA = $JAVA"
echo "CLASSPATH = $CLASSPATH"
if (( NO_START )); then
rudder-jetty/SOURCES/patches/jetty/jetty-init-sles.patch
--- jetty7/bin/jetty-sles.sh 2014-11-21 18:18:10.761944184 +0100
+++ jetty7/bin/jetty-sles.sh 2014-11-21 18:17:40.897795646 +0100
--- jetty/bin/jetty-sles.sh 2014-11-21 18:18:10.761944184 +0100
+++ jetty/bin/jetty-sles.sh 2014-11-21 18:17:40.897795646 +0100
@@ -512,7 +512,7 @@
rm -f ${JETTY_STATE}
rudder-jetty/SOURCES/patches/jetty/jetty-init-softokn-version-check.patch
--- jetty7/bin/jetty-rpm.sh.orig 2017-05-17 13:56:36.919856595 +0200
+++ jetty7/bin/jetty-rpm.sh 2017-05-17 14:01:52.135850950 +0200
--- jetty/bin/jetty-rpm.sh.orig 2017-05-17 13:56:36.919856595 +0200
+++ jetty/bin/jetty-rpm.sh 2017-05-17 14:01:52.135850950 +0200
@@ -483,6 +483,18 @@
UMASK="0007"
echo "Setting umask to ${UMASK}"
rudder-jetty/SOURCES/patches/jetty/jetty-init-stop-fix.patch
--- jetty7/bin/jetty.sh 2012-11-05 15:44:19.000000000 +0100
+++ jetty7/bin/jetty.sh 2012-11-05 15:55:07.000000000 +0100
--- jetty/bin/jetty.sh 2012-11-05 15:44:19.000000000 +0100
+++ jetty/bin/jetty.sh 2012-11-05 15:55:07.000000000 +0100
@@ -503,6 +503,10 @@
if (( TIMEOUT-- == 0 )); then
start-stop-daemon -K -p"$JETTY_PID" -d"$JETTY_HOME" -a "$JAVA" -s KILL
rudder-jetty/SOURCES/patches/jetty/jetty-init-stop-forcestop.patch
--- jetty7/bin/jetty.sh.orig 2015-12-07 19:25:57.456283949 +0100
+++ jetty7/bin/jetty.sh 2015-12-07 19:41:05.075633380 +0100
--- jetty/bin/jetty.sh.orig 2015-12-07 19:25:57.456283949 +0100
+++ jetty/bin/jetty.sh 2015-12-07 19:41:05.075633380 +0100
@@ -164,6 +164,21 @@
ACTION=$1
shift
......
fi
+ # Ensure jetty is not still running
+ PIDS=`${PS_COMMAND} | egrep "[j]ava .* /opt/rudder/jetty7/start.jar" | awk '{print $2}'`
+ PIDS=`${PS_COMMAND} | egrep "[j]ava .* /opt/rudder/jetty/start.jar" | awk '{print $2}'`
+ for PID in ${PIDS}
+ do
+ # Still running. We need to kill it with the force.
rudder-jetty/SOURCES/patches/jetty/jetty-init-ulimit.patch
diff -ruN jetty7/bin/jetty-sles.sh jetty7.new/bin/jetty-sles.sh
--- jetty7/bin/jetty-sles.sh 2016-10-11 15:16:32.722556334 +0200
+++ jetty7.new/bin/jetty-sles.sh 2017-03-16 15:03:49.524071690 +0100
diff -ruN jetty/bin/jetty-sles.sh jetty.new/bin/jetty-sles.sh
--- jetty/bin/jetty-sles.sh 2016-10-11 15:16:32.722556334 +0200
+++ jetty.new/bin/jetty-sles.sh 2017-03-16 15:03:49.524071690 +0100
@@ -103,6 +103,7 @@
[ $# -gt 0 ] || usage
rudder-jetty/SOURCES/patches/jetty/jetty-init-umask.patch
--- jetty7/bin/jetty.sh.orig 2014-03-13 00:55:51.261843139 +0100
+++ jetty7/bin/jetty.sh 2014-03-13 00:56:57.505715067 +0100
@@ -431,6 +431,8 @@
--- jetty/bin/jetty.sh.orig 2017-10-20 18:44:16.263661812 +0200
+++ jetty/bin/jetty.sh 2017-10-20 18:52:56.183656275 +0200
@@ -435,6 +435,8 @@
##################################################
case "$ACTION" in
start)
......
+ echo "Setting umask to ${UMASK}"
echo -n "Starting Jetty: "
if (( NO_START )); then
@@ -446,10 +448,11 @@
if (( NO_START )); then
@@ -450,7 +452,7 @@
CH_USER="-c$JETTY_USER"
fi
- start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_HOME" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" --daemon
+ start-stop-daemon -k ${UMASK} -S -p"$JETTY_PID" $CH_USER -d"$JETTY_HOME" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" --daemon
- start-stop-daemon -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_START_LOG"
+ start-stop-daemon -k ${UMASK} -S -p"$JETTY_PID" $CH_USER -d"$JETTY_BASE" -b -m -a "$JAVA" -- "${RUN_ARGS[@]}" start-log-file="$JETTY_START_LOG"
else
+ umask ${UMASK}
if [ -f "$JETTY_PID" ]
then
if running $JETTY_PID
rudder-jetty/SOURCES/patches/jetty/jetty-init-use-rudder-jetty-defaults.patch
--- jetty7/bin/jetty.sh.orig 2014-03-13 01:14:20.518910880 +0100
+++ jetty7/bin/jetty.sh 2014-03-13 01:15:31.630682858 +0100
@@ -173,11 +173,10 @@
--- jetty/bin/jetty.sh 2017-10-20 19:27:44.756967360 +0200
+++ jetty/bin/jetty.sh_4 2017-10-20 21:07:09.763737790 +0200
@@ -210,11 +210,10 @@
ETC=$HOME/etc
fi
-for CONFIG in $ETC/default/jetty{,7} $HOME/.jettyrc; do
- if [ -f "$CONFIG" ] ; then
-for CONFIG in {/etc,~/etc}/default/${NAME}{,9} $HOME/.${NAME}rc; do
- if [ -f "$CONFIG" ] ; then
- readConfig "$CONFIG"
- fi
-done
+CONFIG=/etc/default/rudder-jetty
+if [ -f "$CONFIG" ] ; then
+if [ -f "$CONFIG" ] ; then
+ readConfig "$CONFIG"
+fi
rudder-jetty/SOURCES/rudder-jetty-base/etc/console-capture.xml
<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
<Configure id="logging" class="org.eclipse.jetty.util.log.Log">
<New id="ServerLog" class="java.io.PrintStream">
<Arg>
<New class="org.eclipse.jetty.util.RolloverFileOutputStream">
<Arg><Property name="jetty.console-capture.dir" deprecated="jetty.logging.dir" default="/var/log/rudder/webapp"/>/yyyy_mm_dd.jetty.log</Arg>
<Arg type="boolean"><Property name="jetty.console-capture.append" deprecated="jetty.logging.append" default="false"/></Arg>
<Arg type="int"><Property name="jetty.console-capture.retainDays" deprecated="jetty.logging.retainDays" default="90"/></Arg>
<Arg>
<Call class="java.util.TimeZone" name="getTimeZone">
<Arg><Property name="jetty.console-capture.timezone" deprecated="jetty.logging.timezone" default="GMT"/></Arg>
</Call>
</Arg>
<Get id="ServerLogName" name="datedFilename"/>
</New>
</Arg>
</New>
<Get name="rootLogger">
<Call name="info"><Arg>Console stderr/stdout captured to <Ref refid="ServerLogName"/></Arg></Call>
</Get>
<Call class="java.lang.System" name="setErr"><Arg><Ref refid="ServerLog"/></Arg></Call>
<Call class="java.lang.System" name="setOut"><Arg><Ref refid="ServerLog"/></Arg></Call>
</Configure>
rudder-jetty/SOURCES/rudder-jetty-base/resources/jetty-logging.properties
## Force jetty logging implementation
#org.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog
## Set logging levels from: ALL, DEBUG, INFO, WARN, OFF
#org.eclipse.jetty.LEVEL=INFO
#com.example.LEVEL=INFO
## Hide stacks traces in logs?
#com.example.STACKS=false
## Show the source file of a log location?
#com.example.SOURCE=false
rudder-jetty/SOURCES/rudder-jetty-base/start.ini
#===========================================================
# Jetty Startup
#
# See documentation about {jetty.base} at
# http://www.eclipse.org/jetty/documentation/current/startup.html
#
# This directory must be configured as $JETTY_BASE for Rudder.
# You must also configure $JETTY_HOME where the default jetty
# distribution is installed (/opt/rudder/jetty)
#
# To start rudder:
# java -jar $JETT_HOME/start.jar jetty.base=$JETTY_BASE
#
#===========================================================
# ---------------------------------------
# Module: ext
# Adds all jar files discovered in $JETTY_HOME/lib/ext
# and $JETTY_BASE/lib/ext to the servers classpath.
# ---------------------------------------
#--module=ext
# ---------------------------------------
# Module: resources
# Adds the $JETTY_HOME/resources and/or $JETTY_BASE/resources
# directory to the server classpath. Useful for configuration
# property files (eg jetty-logging.properties)
# ---------------------------------------
--module=resources
# ---------------------------------------
# Module: setuid
# Enables the unix setUID configuration so that the server
# may be started as root to open privileged ports/files before
# changing to a restricted user (eg jetty).
# ---------------------------------------
--module=setuid
## SetUID Configuration
jetty.setuid.startServerAsPrivileged=true
jetty.setuid.userName=root
jetty.setuid.groupName=root
jetty.setuid.umask=0007
# ---------------------------------------
# Module: server
# Enables the core Jetty server on the classpath.
# ---------------------------------------
--module=server
### ThreadPool configuration
## Minimum number of threads
# jetty.threadPool.minThreads=10
## Maximum number of threads
# jetty.threadPool.maxThreads=200
## Thread idle timeout (in milliseconds)
# jetty.threadPool.idleTimeout=60000
### Common HTTP configuration
## Scheme to use to build URIs for secure redirects
# jetty.httpConfig.secureScheme=https
## Port to use to build URIs for secure redirects
# jetty.httpConfig.securePort=8443
## Response content buffer size (in bytes)
# jetty.httpConfig.outputBufferSize=32768
## Max response content write length that is buffered (in bytes)
# jetty.httpConfig.outputAggregationSize=8192
## Max request headers size (in bytes)
jetty.httpConfig.requestHeaderSize=8192
## Max response headers size (in bytes)
# jetty.httpConfig.responseHeaderSize=8192
## Whether to send the Server: header
jetty.httpConfig.sendServerVersion=true
## Whether to send the Date: header
jetty.httpConfig.sendDateHeader=false
## Max per-connection header cache size (in nodes)
# jetty.httpConfig.headerCacheSize=512
## Whether, for requests with content, delay dispatch until some content has arrived
# jetty.httpConfig.delayDispatchUntilContent=true
## Maximum number of error dispatches to prevent looping
# jetty.httpConfig.maxErrorDispatches=10
## Maximum time to block in total for a blocking IO operation (default -1 is to use idleTimeout on progress)
# jetty.httpConfig.blockingTimeout=-1
## Cookie compliance mode of: RFC2965, RFC6265
# jetty.httpConfig.cookieCompliance=RFC6265
### Server configuration
## Whether ctrl+c on the console gracefully stops the Jetty server
# jetty.server.stopAtShutdown=true
## Timeout in ms to apply when stopping the server gracefully
# jetty.server.stopTimeout=5000
## Dump the state of the Jetty server, components, and webapps after startup
# jetty.server.dumpAfterStart=false
## Dump the state of the Jetty server, components, and webapps before shutdown
# jetty.server.dumpBeforeStop=false
# ---------------------------------------
# Module: deploy
# Enables webapplication deployment from the webapps directory.
# ---------------------------------------
--module=deploy
# Monitored directory name (relative to $jetty.base)
# jetty.deploy.monitoredDir=webapps
# - OR -
# Monitored directory path (fully qualified)
jetty.deploy.monitoredPath=/opt/rudder/share/webapps
# Defaults Descriptor for all deployed webapps
# jetty.deploy.defaultsDescriptorPath=${jetty.base}/etc/webdefault.xml
# Monitored directory scan period (seconds)
# jetty.deploy.scanInterval=1
# Whether to extract *.war files
# jetty.deploy.extractWars=true
# ---------------------------------------
# Module: webapp
# Adds support for servlet specification webapplication to the server
# classpath. Without this, only Jetty specific handlers may be deployed.
# ---------------------------------------
--module=webapp
## Add to the server wide default jars and packages protected or hidden from webapps.
## System classes are protected and cannot be overridden by a webapp.
## Server classes are hidden and cannot be seen by a webapp
## Lists of patterns are comma separated and may be either:
## + a qualified classname e.g. 'com.acme.Foo'
## + a package name e.g. 'net.example.'
## + a jar file e.g. '${jetty.base.uri}/lib/dependency.jar'
## + a directory of jars,resource or classes e.g. '${jetty.base.uri}/resources'
## + A pattern preceeded with a '-' is an exclusion, all other patterns are inclusions
##
## The +=, operator appends to a CSV list with a comma as needed.
##
#jetty.webapp.addSystemClasses+=,org.example.
#jetty.webapp.addServerClasses+=,org.example.
# ---------------------------------------
# Module: http
# Enables a HTTP connector on the server.
# By default HTTP/1 is support, but HTTP2C can
# be added to the connector with the http2c module.
# ---------------------------------------
--module=http
### HTTP Connector Configuration
## Connector host/address to bind to
jetty.http.host=127.0.0.1
## Connector port to listen on
jetty.http.port=8080
## Connector idle timeout in milliseconds
# jetty.http.idleTimeout=30000
## Connector socket linger time in seconds (-1 to disable)
# jetty.http.soLingerTime=-1
## Number of acceptors (-1 picks default based on number of cores)
# jetty.http.acceptors=-1
## Number of selectors (-1 picks default based on number of cores)
# jetty.http.selectors=-1
## ServerSocketChannel backlog (0 picks platform default)
# jetty.http.acceptorQueueSize=0
## Thread priority delta to give to acceptor threads
# jetty.http.acceptorPriorityDelta=0
## Reserve threads for high priority tasks (-1 use a heuristic, 0 no reserved threads)
# jetty.http.reservedThreads=-1
## Connect Timeout in milliseconds
# jetty.http.connectTimeout=15000
## HTTP Compliance: RFC7230, RFC2616, LEGACY
# jetty.http.compliance=RFC7230
# ---------------------------------------
# Module: console-capture
# Redirects JVMs console stderr and stdout to a log file,
# including output from Jetty's default StdErrLog logging.
# ---------------------------------------
--module=console-capture
## Logging directory (relative to $jetty.base)
# jetty.console-capture.dir=logs
## Whether to append to existing file
# jetty.console-capture.append=true
## How many days to retain old log files
# jetty.console-capture.retainDays=90
## Timezone of the log timestamps
# jetty.console-capture.timezone=GMT
# ---------------------------------------
# Module: requestlog
# Enables a NCSA style request log.
# ---------------------------------------
--module=requestlog
## Logging directory (relative to $jetty.base)
# jetty.requestlog.dir=logs
## File path
# jetty.requestlog.filePath=${jetty.requestlog.dir}/yyyy_mm_dd.request.log
jetty.requestlog.filePath=/var/log/rudder/webapp/yyyy_mm_dd.request.log
## Date format for rollovered files (uses SimpleDateFormat syntax)
# jetty.requestlog.filenameDateFormat=yyyy_MM_dd
## How many days to retain old log files
# jetty.requestlog.retainDays=90
## Whether to append to existing file
# jetty.requestlog.append=false
## Whether to use the extended log output
# jetty.requestlog.extended=true
## Whether to log http cookie information
# jetty.requestlog.cookies=true
## Timezone of the log entries
# jetty.requestlog.timezone=GMT
## Whether to log LogLatency
# jetty.requestlog.loglatency=false
rudder-jetty/SOURCES/rudder-jetty.conf
-Drun.mode=production"
# Jetty settings
JETTY_HOME="/opt/rudder/jetty7/"
JETTY_HOME="/opt/rudder/jetty/"
JETTY_BASE="/opt/rudder/etc/rudder-jetty-base/"
JETTY_RUN="/var/rudder/run"
JETTY_ARGS="OPTIONS=Server"
JETTY_LOGS="/var/log/rudder/webapp/"
# By default, Jetty stores files it's going to *serve* under /tmp
# This causes trouble, if tmpwatch cleans them up (or a over-zealous user)
rudder-jetty/SPECS/rudder-jetty.spec
#=================================================
# Specification file for rudder-jetty
#
# Installs Jetty7
# Installs Jetty
#
# Copyright (C) 2011 Normation
#=================================================
......
%define ruddervardir /var/rudder
%define rudderlogdir /var/log/rudder
%define jetty_release 7.2.2
%define date_release 20101205
%define jetty_release 9.4.7
%define date_release 20170914
%define _binaries_in_noarch_packages_terminate_build 0
......
Group: Applications/System
#Source1: jetty7/bin/jetty.sh
#Source1: jetty/bin/jetty.sh
Source2: rudder-jetty.default
Source3: rudder-jetty.conf
Source4: rudder-jetty
......
cd %{_topdir}/SOURCES
cp -a jetty7 %{buildroot}/opt/rudder
cp -a jetty %{buildroot}/opt/rudder
cp -a rudder-jetty-base %{buildroot}/opt/rudder/etc
# Init script
mkdir -p %{buildroot}/etc/init.d
mkdir -p %{buildroot}/etc/default
install -m 755 jetty7/bin/%{jetty_init_script} %{buildroot}/etc/init.d/rudder-jetty
install -m 755 jetty/bin/%{jetty_init_script} %{buildroot}/etc/init.d/rudder-jetty
install -m 644 %{SOURCE2} %{buildroot}/etc/default/rudder-jetty
install -m 644 %{SOURCE3} %{buildroot}/opt/rudder/etc/rudder-jetty.conf
......
fi
fi
if [ -x /opt/jetty7 ]
then
TMP_BACKUP=`mktemp -d -t jetty.backup.XXXXXXXXXX -q`
mv /opt/jetty7 $TMP_BACKUP/
fi
%post -n rudder-jetty
#=================================================
# Post Installation
......
#=================================================
%files -n rudder-jetty
%defattr(-, root, root, 0755)
/opt/rudder/jetty7
/opt/rudder/jetty
/opt/rudder/etc
/opt/rudder/etc/rudder-jetty-base
%{rudderlogdir}/webapp
/var/rudder/run
/etc/init.d/rudder-jetty
rudder-jetty/debian/rules
dh_install --SOURCEDIR=$(CURDIR)/BUILD/ rudder-jetty /etc/default/
cp -f $(CURDIR)/debian/rudder-jetty.init $(CURDIR)/BUILD/rudder-jetty
dh_install --SOURCEDIR=$(CURDIR)/BUILD/ rudder-jetty /etc/init.d/
dh_install --sourcedir=$(CURDIR)/SOURCES jetty7 /opt/rudder
dh_install --sourcedir=$(CURDIR)/SOURCES jetty /opt/rudder
dh_install --sourcedir=$(CURDIR)/SOURCES rudder-jetty-base /opt/rudder/etc
dh_install --sourcedir=$(CURDIR)/SOURCES rudder-jetty.conf /opt/rudder/etc
dh_install --SOURCEDIR=$(CURDIR)/SOURCES/ rudder-jetty /opt/rudder/etc/server-roles.d/
# dh_installmenu
rudder-webapp/SPECS/rudder-webapp.spec
mkdir -p %{buildroot}/usr/share/doc/rudder
# Emulate installation of file rudder.xml in order to be owned by package
mkdir -p %{buildroot}%{rudderdir}/jetty7/contexts/
touch %{buildroot}%{rudderdir}/jetty7/contexts/rudder.xml
touch %{buildroot}%{rudderdir}/share/webapp/rudder.xml
# Install helper scripts
cp %{SOURCE10} %{buildroot}%{rudderdir}/bin/
......
## Add execution permission for ncf-api on pre/post-hooks
chmod -R 2750 %{ruddervardir}/configuration-repository/ncf/ncf-hooks.d/
# Create a symlink to the Jetty context if necessary
if [ -d "%{rudderdir}/jetty7/contexts" ]; then
ln -sf %{rudderdir}/share/webapps/rudder.xml %{rudderdir}/jetty7/contexts/rudder.xml
fi
if [ -f /tmp/rudder-plugins-upgrade ]
then
/opt/rudder/bin/rudder-pkg plugin restore-status < /tmp/rudder-plugins-upgrade
......
%config(noreplace) %{rudderdir}/etc/logback.xml
%config(noreplace) %{rudderdir}/etc/rudder-passwords.conf
%attr(0600, root, root) %{rudderdir}/etc/rudder-passwords.conf
# Prevent /opt/rudder/jetty7/contexts/rudder.xml to be erased during upgrade
%ghost %{rudderdir}/jetty7/contexts/rudder.xml
%{rudderdir}/bin/
%{rudderdir}/bin/rudder-node-to-relay
rudder-webapp/debian/postinst
RUDDER_WEB_PROPERTIES="/opt/rudder/etc/rudder-web.properties"
# Create a symlink to the Jetty context if necessary
if [ -d "/opt/rudder/jetty7/contexts" ]; then
ln -sf /opt/rudder/share/webapps/rudder.xml /opt/rudder/jetty7/contexts/rudder.xml
fi
if [ -f /tmp/rudder-plugins-upgrade ]
then
/opt/rudder/bin/rudder-pkg plugin restore-status < /tmp/rudder-plugins-upgrade

Also available in: Unified diff