From 5d838d21946628723948256452827deb52702b6c Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Fri, 19 Oct 2018 15:18:29 +0200 Subject: [PATCH] wait with kopano-server startup until ssl certificates are present Signed-off-by: Felix Bartels --- core/start-service.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/start-service.sh b/core/start-service.sh index f3d0c2f..327dfa7 100755 --- a/core/start-service.sh +++ b/core/start-service.sh @@ -17,8 +17,8 @@ echo "Set ownership" | ts chown -R kopano:kopano /run /tmp chown kopano:kopano /kopano/data/ /kopano/data/attachments -echo "Clean old pid files and sockets" | ts -rm -f /var/run/kopano/* +#echo "Clean old pid files and sockets" | ts +#rm -f /var/run/kopano/* # allow helper commands given by "docker-compose run" if [ $# -gt 0 ] @@ -30,6 +30,11 @@ fi # start regular service case "$SERVICE_TO_START" in server) + # TODO the until loop needs to be extended for the other services and certificates + until [[ -f $KCCONF_SERVER_SERVER_SSL_KEY_FILE && -f $KCCONF_SERVER_SERVER_SSL_CA_FILE ]]; do + echo "waiting for $KCCONF_SERVER_SERVER_SSL_KEY_FILE & $KCCONF_SERVER_SERVER_SSL_CA_FILE"| ts + sleep 5 + done exec /usr/sbin/kopano-server -F ;; dagent)