Commit b765a327 authored by benedikt.kroening's avatar benedikt.kroening
Browse files

Using health-check endpoint from middleware for readiness checks

parent 09b1cc7a
...@@ -53,7 +53,7 @@ if [ ! -f ${INIT_STATE_FILE} ]; then ...@@ -53,7 +53,7 @@ if [ ! -f ${INIT_STATE_FILE} ]; then
restartService open-xchange restartService open-xchange
sleep 10 sleep 10
waitPort localhost 8009 waitTillAppsuiteReady
# setting propper filestore permissions ... # setting propper filestore permissions ...
mkdir -p /var/opt/filestore mkdir -p /var/opt/filestore
......
...@@ -81,7 +81,6 @@ if [ -f "/opt/open-xchange/etc/000-ox-restart-required" ]; then ...@@ -81,7 +81,6 @@ if [ -f "/opt/open-xchange/etc/000-ox-restart-required" ]; then
rm -f /opt/open-xchange/etc/000-ox-restart-required rm -f /opt/open-xchange/etc/000-ox-restart-required
echo "" echo ""
waitPort localhost 8009
waitTillAppsuiteReady waitTillAppsuiteReady
echo "Trying to execute all updates tasks ..." echo "Trying to execute all updates tasks ..."
......
...@@ -266,8 +266,7 @@ if [[ "${GUARD_ENABLE}" = true ]]; then ...@@ -266,8 +266,7 @@ if [[ "${GUARD_ENABLE}" = true ]]; then
fi fi
if [[ "${GUARD_BACKEND}" = true ]]; then if [[ "${GUARD_BACKEND}" = true ]]; then
waitPort localhost 8009 wwaitTillAppsuiteReady
waitTillAppsuiteReady
/opt/open-xchange/sbin/runallupdate -A ${OX_ADMINMASTER_USER} -P ${OX_ADMINMASTER_PASS} /opt/open-xchange/sbin/runallupdate -A ${OX_ADMINMASTER_USER} -P ${OX_ADMINMASTER_PASS}
......
...@@ -298,31 +298,13 @@ function exportProperties { ...@@ -298,31 +298,13 @@ function exportProperties {
function waitTillAppsuiteReady { function waitTillAppsuiteReady {
set +e set +e
echo -n "Waiting for service re-start (max. 240 seconds)." echo "Waiting till App Suite health checker returns 200 ... "
y=0 timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8009/health)" != "200" ]]; do echo "." && sleep 5; done' || false
while [[ ${y} -lt 24 ]]; do
/opt/open-xchange/sbin/allpluginsloaded > /dev/null 2>&1
if [[ $? -ne 0 ]]; then
echo "."
sleep 10
y=$((y+1))
else
echo " done."
break
fi
done
if [[ ${y} -ge 48 ]]; then
echo ""
echo ""
echo "/!\\ Reached timeout. Please check manually why bundles refused to start /!\\"
echo "/!\\ For example by running ${AS_BIN}listbundles /!\\"
echo ""
echo ""
fi
set -e set -e
} }
function loadConfig { function loadConfig {
# temporary enabling extended shell debugging to retrieve functions definition location - in this case myself ... # temporary enabling extended shell debugging to retrieve functions definition location - in this case myself ...
if [[ -z "$INSTALLER_ROOT" ]] ; then if [[ -z "$INSTALLER_ROOT" ]] ; then
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment