Commit cbb798cf2427e398cc36594effc6412980b5b8ae

Authored by Antonio Terceiro
1 parent bb680e0a

script/quick-start: wait for postgresql to start

Depending on the setup PostgreSQL might still be starting up when we get
to the first point where Rails will try connecting, and will fail with:

  PG::ConnectionBad: FATAL:  the database system is starting up

So we wait for PostgreSQL to be ready.
Showing 1 changed file with 3 additions and 0 deletions   Show diff stats
script/quick-start
@@ -96,6 +96,9 @@ fi @@ -96,6 +96,9 @@ fi
96 96
97 # Ensure database is running 97 # Ensure database is running
98 sudo service postgresql start 98 sudo service postgresql start
  99 +while ! sudo -u postgres psql < /dev/null >/dev/null 2>&1; do
  100 + sleep 5s
  101 +done
99 102
100 if test -e config/database.yml && test "$force_install" = 'false'; then 103 if test -e config/database.yml && test "$force_install" = 'false'; then
101 say 'Not updating existent database.yml.' 104 say 'Not updating existent database.yml.'