-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #7469: /etc/init.d/rudder-jetty restart does not restart jetty #830
Merged
peckpeck
merged 1 commit into
Normation:branches/rudder/2.11
from
jooooooon:bug_7469/etc_init_d_rudder_jetty_restart_does_not_restart_jetty
Dec 8, 2015
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
57 changes: 57 additions & 0 deletions
57
rudder-jetty/SOURCES/patches/jetty/jetty-init-stop-forcestop.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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- 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 | ||
@@ -164,6 +164,21 @@ | ||
ACTION=$1 | ||
shift | ||
|
||
+# Detect the correct ps tool to use | ||
+ns=$(ps --no-header -o utsns --pid $$ 2>/dev/null || true) | ||
+if [ -e "/proc/bc/0" ]; then # we have openvz | ||
+ if [ -e /bin/vzps ]; then # we have vzps | ||
+ PS_COMMAND="/bin/vzps -E 0" | ||
+ else # use rudder provided vzps | ||
+ PS_COMMAND="/opt/rudder/bin/vzps.py -E 0" | ||
+ fi | ||
+elif [ -n "${ns}" ]; then # we have namespaces | ||
+ # the sed is here to prepend a fake user field that is removed by the -o option (it is never used) | ||
+ PS_COMMAND="eval ps --no-header -e -O utsns | grep -E '^[[:space:]]*[[:digit:]]*[[:space:]]+${ns}' | sed 's/^/user /'" | ||
+else # standard unix | ||
+ PS_COMMAND="ps -ef" | ||
+fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is copied from rudder-agent.init |
||
+ | ||
################################################## | ||
# Read any configuration files | ||
################################################## | ||
@@ -553,7 +568,7 @@ | ||
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. Trying with force..." | ||
break | ||
fi | ||
|
||
@@ -574,7 +589,7 @@ | ||
kill -KILL "$PID" 2>/dev/null | ||
fi | ||
if (( TIMEOUT < -10 )); then | ||
- echo "Failed to stop Jetty. Giving up." | ||
+ echo "Failed to stop Jetty. Trying with force..." | ||
break | ||
fi | ||
|
||
@@ -587,6 +602,14 @@ | ||
echo OK | ||
fi | ||
|
||
+ # Ensure jetty is not still running | ||
+ PIDS=`${PS_COMMAND} | egrep "[j]ava .* /opt/rudder/jetty7/start.jar" | awk '{print $2}'` | ||
+ for PID in ${PIDS} | ||
+ do | ||
+ # Still running. We need to kill it with the force. | ||
+ kill -KILL ${PID} | ||
+ done | ||
+ | ||
;; | ||
|
||
restart) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved this file to ease merges into the upper branches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍