diff --git a/tools/setup/postgres-init-dev-db b/tools/setup/postgres-init-dev-db index ddc0eba964..1388041884 100755 --- a/tools/setup/postgres-init-dev-db +++ b/tools/setup/postgres-init-dev-db @@ -39,6 +39,15 @@ fi DBNAME_BASE=${DBNAME}_base +if ! pg_isready -U "$DEFAULT_USER" -q; then + set +x + echo + echo 'ERROR: PostgreSQL Server is not running! Ensure the service is enabled.' + echo 'ERROR: Try `sudo service postgresql start`?' + echo "ERROR: You can easily test if you fixed it using: pg_isready -U \$DEFAULT_USER" + exit 1 +fi + $ROOT_POSTGRES "$DEFAULT_DB" << EOF CREATE USER $USERNAME; ALTER USER $USERNAME PASSWORD '$PASSWORD';