Commit 174d16ba authored by benedikt.kroening's avatar benedikt.kroening
Browse files

Using health-check endpoint from middleware for readiness checks

parent 07f490d0
......@@ -53,7 +53,7 @@ if [ ! -f ${INIT_STATE_FILE} ]; then
restartService open-xchange
sleep 10
waitPort localhost 8009
waitTillAppsuiteReady
# setting propper filestore permissions ...
mkdir -p /var/opt/filestore
......
......@@ -81,6 +81,5 @@ if [ -f "/opt/open-xchange/etc/000-ox-restart-required" ]; then
rm -f /opt/open-xchange/etc/000-ox-restart-required
echo ""
waitPort localhost 8009
waitTillAppsuiteReady
fi
\ No newline at end of file
......@@ -267,8 +267,7 @@ if [[ "${GUARD_ENABLE}" = true ]]; then
fi
if [[ "${GUARD_BACKEND}" = true ]]; then
waitPort localhost 8009
waitTillAppsuiteReady
wwaitTillAppsuiteReady
/opt/open-xchange/sbin/runallupdate
......
......@@ -302,31 +302,13 @@ function exportProperties {
function waitTillAppsuiteReady {
set +e
echo -n "Waiting for service re-start (max. 240 seconds)."
y=0
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
echo "Waiting till App Suite health checker returns 200 ... "
timeout 300 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8009/health)" != "200" ]]; do echo "." && sleep 5; done' || false
set -e
}
function loadConfig {
# temporary enabling extended shell debugging to retrieve functions definition location - in this case myself ...
if [[ -z "$INSTALLER_ROOT" ]] ; then
......
Markdown is supported
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