forked from Normation/rudder-packages
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #23622: Some jetty patches don't apply to 10.0.17
- Loading branch information
Showing
7 changed files
with
75 additions
and
108 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
27 changes: 15 additions & 12 deletions
27
rudder-server/SOURCES/patches/jetty/jetty-init-redirect-stderrout.patch
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 |
---|---|---|
@@ -1,24 +1,27 @@ | ||
--- jetty/bin/jetty.sh.orig 2018-08-29 09:38:33.684462836 +0200 | ||
+++ jetty/bin/jetty.sh 2018-08-29 09:40:57.763691920 +0200 | ||
@@ -317,6 +317,7 @@ | ||
@@ -411,6 +411,7 @@ fi | ||
##################################################### | ||
# 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" | ||
@@ -520,11 +521,11 @@ | ||
# FIXME: Broken solution: wordsplitting, pathname expansion, arbitrary command execution, etc. | ||
@@ -621,13 +622,13 @@ case "$ACTION" in | ||
chown "$JETTY_USER" "$JETTY_PID" | ||
su - "$JETTY_USER" $SU_SHELL -c " | ||
cd \"$JETTY_BASE\" | ||
- 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\"" | ||
- echo ${RUN_ARGS[*]} --start-log-file=\"$JETTY_START_LOG\" | xargs ${JAVA} > /dev/null & | ||
+ echo ${RUN_ARGS[*]} --start-log-file=\"$JETTY_START_LOG\" | xargs ${JAVA} >${JETTY_START_LOG} 2>&1 & | ||
PID=\$! | ||
disown \$PID" | ||
(( DEBUG )) && echo "Starting: su shell (w/user $JETTY_USER) on PID $PID" | ||
else | ||
- "${RUN_CMD[@]}" > /dev/null & | ||
+ "${RUN_CMD[@]}" >${JETTY_START_LOG} 2>&1 & | ||
disown $! | ||
echo $! > "$JETTY_PID" | ||
fi | ||
# Startup if not switching users | ||
- echo ${RUN_ARGS[*]} --start-log-file="${JETTY_START_LOG}" | xargs ${JAVA} > /dev/null & | ||
+ echo ${RUN_ARGS[*]} --start-log-file="${JETTY_START_LOG}" | xargs ${JAVA} >${JETTY_START_LOG} 2>&1 & | ||
PID=$! | ||
disown $PID | ||
(( DEBUG )) && echo "Starting: java command on PID $PID" | ||
|
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 |
---|---|---|
@@ -1,21 +1,20 @@ | ||
--- 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} | ||
|
||
--- jetty/bin/jetty-sles.sh | ||
+++ jetty/bin/jetty-sles.sh | ||
@@ -609,7 +609,7 @@ case "$ACTION" in | ||
checkAvailableRam $((${JAVA_XMX}+150)) | ||
|
||
# Startup from a service file | ||
- if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1 | ||
+ if [ "$START_STOP_DAEMON" = "1" ] && [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1 | ||
then | ||
unset CH_USER | ||
if [ -n "$JETTY_USER" ] | ||
@@ -570,7 +570,7 @@ | ||
|
||
@@ -681,7 +681,7 @@ case "$ACTION" in | ||
stop) | ||
echo -n "Stopping Jetty: " | ||
# Stop from a service file | ||
- if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1; then | ||
+ if [ "$START_STOP_DAEMON" = "1" ] && [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1; then | ||
start-stop-daemon -K -p"$JETTY_PID" -d"$JETTY_HOME" -a "$JAVA" -s HUP | ||
|
||
TIMEOUT=30 | ||
|
||
TIMEOUT=30 |
22 changes: 6 additions & 16 deletions
22
rudder-server/SOURCES/patches/jetty/jetty-init-stop-fix.patch
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 |
---|---|---|
@@ -1,24 +1,14 @@ | ||
--- 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 @@ | ||
--- jetty/bin/jetty.sh | ||
+++ jetty/bin/jetty.sh | ||
@@ -631,6 +631,10 @@ case "$ACTION" in | ||
if (( TIMEOUT-- == 0 )); then | ||
start-stop-daemon -K -p"$JETTY_PID" -d"$JETTY_HOME" -a "$JAVA" -s KILL | ||
fi | ||
+ if (( TIMEOUT < -10 )); then | ||
+ echo "Failed to stop Jetty. Giving up." | ||
+ echo "Failed to stop Jetty. Giving up." | ||
+ break | ||
+ fi | ||
|
||
sleep 1 | ||
done | ||
@@ -518,6 +522,10 @@ | ||
if (( TIMEOUT-- == 0 )); then | ||
kill -KILL "$PID" 2>/dev/null | ||
fi | ||
+ if (( TIMEOUT < -10 )); then | ||
+ echo "Failed to stop Jetty. Giving up." | ||
+ break | ||
+ fi | ||
|
||
|
||
sleep 1 | ||
done | ||
|
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
20 changes: 9 additions & 11 deletions
20
rudder-server/SOURCES/patches/jetty/jetty-init-umask.patch
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 |
---|---|---|
@@ -1,22 +1,20 @@ | ||
--- jetty/bin/jetty.sh.orig | ||
+++ jetty/bin/jetty.sh | ||
@@ -451,6 +451,9 @@ fi | ||
case "$ACTION" in | ||
start) | ||
@@ -546,6 +546,9 @@ case "$ACTION" in | ||
fi | ||
|
||
echo -n "Starting Jetty: " | ||
+ UMASK="0007" | ||
+ echo "Setting umask to ${UMASK}" | ||
+ | ||
|
||
if (( NO_START )); then | ||
echo "Not starting ${NAME} - NO_START=1"; | ||
@@ -465,7 +468,7 @@ case "$ACTION" in | ||
CH_USER="--chuid $JETTY_USER" | ||
# Startup from a service file | ||
if [ $UID -eq 0 ] && type start-stop-daemon > /dev/null 2>&1 | ||
@@ -557,6 +560,7 @@ case "$ACTION" in | ||
fi | ||
|
||
- start-stop-daemon --start $CH_USER \ | ||
+ start-stop-daemon -k ${UMASK} --start $CH_USER \ | ||
echo ${RUN_ARGS[@]} --start-log-file="$JETTY_START_LOG" | xargs start-stop-daemon \ | ||
+ -k ${UMASK} \ | ||
--start $CH_USER \ | ||
--pidfile "$JETTY_PID" \ | ||
--chdir "$JETTY_BASE" \ | ||
--background \ | ||
|