diff --git a/nix/mariadb-up-mac.nix b/nix/mariadb-up-mac.nix --- a/nix/mariadb-up-mac.nix +++ b/nix/mariadb-up-mac.nix @@ -13,6 +13,10 @@ text = '' MARIADB_DIR=''${XDG_DATA_HOME:-$HOME/.local/share}/MariaDB # 'exec' allows for us to replace bash process with MariaDB + + echo "View MariaDB Logs: tail -f $MARIADB_DIR/logs" >&2 + echo "Kill MariaDB server: pkill mariadbd" >&2 + exec ${mariadb}/bin/mariadbd \ --socket "$MARIADB_DIR"/mysql.sock \ --datadir "$MARIADB_DIR" \ @@ -66,8 +70,10 @@ "${mariadb-entrypoint}/bin/mariadb-init" \ "$MARIADB_PIDFILE" - echo "Waiting for MariaDB to come up" - while [[ ! -S "$MYSQL_UNIX_PORT" ]]; do sleep 1; done + if [[ ! -S "$MYSQL_UNIX_PORT" ]]; then + echo "Waiting for MariaDB to come up" + while [[ ! -S "$MYSQL_UNIX_PORT" ]]; do sleep 1; done + fi # Initialize comm user, database, and secrets file for MariaDB # Connecting through socket doesn't require a password @@ -98,9 +104,6 @@ "${gnused}/bin/sed" -i -e "s|PASS|$PASS|g" "$KEYSERVER_DB_CONFIG" fi - echo "View MariaDB Logs: tail -f $MARIADB_DATA_HOME/logs" >&2 - echo "Kill MariaDB server: pkill mariadbd" >&2 - # Explicitly exit this script so the parent shell can determine # when it's safe to return control of terminal to user exit 0 diff --git a/nix/redis-up-mac.nix b/nix/redis-up-mac.nix --- a/nix/redis-up-mac.nix +++ b/nix/redis-up-mac.nix @@ -11,6 +11,10 @@ text = '' REDIS_CACHE_DIR=''${XDG_CACHE_HOME:-$HOME/Library/Caches}/Redis mkdir -p "$REDIS_CACHE_DIR" + + echo "View Redis Logs: tail -f $REDIS_CACHE_DIR/logs" >&2 + echo "Kill Redis server: pkill redis" >&2 + # 'exec' allows for us to replace bash process with MariaDB exec ${redis}/bin/redis-server \ &> "$REDIS_CACHE_DIR"/logs @@ -34,9 +38,6 @@ "${redis-entrypoint}/bin/redis-init" \ "$REDIS_PIDFILE" - echo "View Redis Logs: tail -f $REDIS_CACHE_DIR/logs" >&2 - echo "Kill Redis server: pkill redis" >&2 - # Explicitly exit this script so the parent shell can determine # when it's safe to return control of terminal to user exit 0