mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-30 09:49:00 +00:00
[#142] Make sure Tomcat stops completely in Docker containers before restarting it
This commit is contained in:
parent
59ad180688
commit
77d48631f4
@ -75,6 +75,10 @@ if [ $DOCKER_CONTAINER = true ]; then
|
|||||||
if [[ $(ss -t -l -n | grep -q LISTEN.*:::8009) -eq 0 ]]; then
|
if [[ $(ss -t -l -n | grep -q LISTEN.*:::8009) -eq 0 ]]; then
|
||||||
echo "Tomcat is running, so we restart it."
|
echo "Tomcat is running, so we restart it."
|
||||||
/usr/libexec/tomcat/server stop
|
/usr/libexec/tomcat/server stop
|
||||||
|
# Wait for Tomcat to stop completely and prevent port bind collisions
|
||||||
|
while [ -z $(tail -n 1 /var/log/tomcat/catalina.$(date +"%Y-%m-%d").log | grep "Destroying ProtocolHandler \[\"http-bio-8443\"\]") ]; do
|
||||||
|
:
|
||||||
|
done
|
||||||
(/usr/libexec/tomcat/server start) &
|
(/usr/libexec/tomcat/server start) &
|
||||||
# Wait for Tomcat to boot completely
|
# Wait for Tomcat to boot completely
|
||||||
until [ "`curl --silent --connect-timeout 1 -I http://localhost:8080 | grep 'Coyote'`" != "" ]; do
|
until [ "`curl --silent --connect-timeout 1 -I http://localhost:8080 | grep 'Coyote'`" != "" ]; do
|
||||||
|
Loading…
Reference in New Issue
Block a user