From 4c1e4ba62e458a37042da3479f69c4fc8d3feed8 Mon Sep 17 00:00:00 2001 From: Tuukka Pasanen Date: Mon, 6 May 2024 13:04:14 +0300 Subject: [PATCH] MDEV-33750: Remove seq in Debian init.d for-loop Make all init.d script for loops to use new {1..5} syntax and rework one not to use seq as all the rest use new Bash syntax. --- debian/mariadb-server.mariadb.init | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/debian/mariadb-server.mariadb.init b/debian/mariadb-server.mariadb.init index c7f42a14c7f..f69538323e8 100644 --- a/debian/mariadb-server.mariadb.init +++ b/debian/mariadb-server.mariadb.init @@ -176,8 +176,18 @@ case "${1:-''}" in # Start MariaDB! /usr/bin/mariadbd-safe "${@:2}" 2>&1 >/dev/null | $ERR_LOGGER & - for _ in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-30}") + # Make sure that there is some default + # 30 seconds is fine default for starting + # maximum is one hour if there is gigantic + # database + MARIADB_STARTUP_TIMEOUT=${MYSQLD_STARTUP_TIMEOUT:-30} + + for i in {1..3600} do + if [ "${i}" -gt "${MARIADB_STARTUP_TIMEOUT}" ] + then + break + fi sleep 1 if mariadbd_status check_alive nowarn then