From e0448d4ac2e58ccc21519671538bc9beeeac14e3 Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Thu, 2 Jan 2020 21:49:01 +0100 Subject: [PATCH] Fix $MYSQL_PORT default fallback & Removes the packed binary in favour of the already working upstream executable --- .bin/wait-for-connection | 47 ---------------------------------------- docker-cron.sh | 2 +- docker-entrypoint.sh | 2 +- 3 files changed, 2 insertions(+), 49 deletions(-) delete mode 100755 .bin/wait-for-connection diff --git a/.bin/wait-for-connection b/.bin/wait-for-connection deleted file mode 100755 index c3bf2fc..0000000 --- a/.bin/wait-for-connection +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/local/bin/php - $timeout) { - $socketTimeout = $timeout; -} -$stopTime = time() + $timeout; -do { - $sock = @fsockopen($host, $port, $errno, $errstr, $socketTimeout); - if ($sock !== false) { - fclose($sock); - fwrite(STDOUT, "\n"); - exit(0); - } - sleep(1); - fwrite(STDOUT, '.'); -} while (time() < $stopTime); -fwrite(STDOUT, "\n"); -exit(1); diff --git a/docker-cron.sh b/docker-cron.sh index ccb0337..36826d9 100755 --- a/docker-cron.sh +++ b/docker-cron.sh @@ -6,7 +6,7 @@ while [ ! -f /var/www/html/bin/daemon.php ]; do done echo "Waiting for MySQL $MYSQL_HOST initialization..." -if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then +if /var/www/html/bin//wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then exec php /var/www/html/bin/daemon.php -f start else echo "[ERROR] Waited 300 seconds, no response" >&2 diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index baed820..8a9577f 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -117,7 +117,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ]; then if [ "$install" = true ]; then echo "Waiting for MySQL $MYSQL_HOST initialization..." - if /usr/local/bin/wait-for-connection "$MYSQL_HOST" "$MYSQL_PORT" 300; then + if /var/www/html/bin/wait-for-connection "$MYSQL_HOST" "${MYSQL_PORT:-3306}" 300; then echo "Starting Friendica installation ..." run_as "php /var/www/html/bin/console.php autoinstall $install_options"