diff --git a/container/hub/run-hub.sh b/container/hub/run-hub.sh index b884167..67a3df0 100755 --- a/container/hub/run-hub.sh +++ b/container/hub/run-hub.sh @@ -54,5 +54,8 @@ fi # ensure /mnt/koji is owned by apache chown -R apache:apache /mnt/koji +# signal we are ready via a file +touch /share/hub.init + # run apache httpd -DFOREGROUND diff --git a/run-koji-container.sh b/run-koji-container.sh index 6624977..a87af8e 100755 --- a/run-koji-container.sh +++ b/run-koji-container.sh @@ -114,8 +114,14 @@ koji_start() { -e POSTGRES_HOST=org.osbuild.koji.postgres \ ${KOJI_HUB_IMAGE} - # TODO: we need to wait for the database to be initialized here. A better method should be used. - sleep 2 + # We need to wait for the database to be initialized here. The container creates a file to let us know + echo "Waiting for DB to be initialized" + while true; do + if [ -f ${SHARE_DIR}/hub.init ]; then + break + fi + sleep 2 + done # create koji users # kojiadmin/kojipass - admin