mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-22 05:19:00 +02:00
* Use `psql' with an empty command to check whether PostgreSQL is up
and running. `pg_ctl status' merely checks whether PostgreSQL is running, not whether it is already accepting connections. This causes Upstart jobs that depend on PostgreSQL to fail. svn path=/nixos/trunk/; revision=20024
This commit is contained in:
parent
83b76bc2cf
commit
cc90f62ceb
|
@ -150,8 +150,10 @@ in
|
|||
# database is running.
|
||||
${run} -c '${postgresql}/bin/pg_ctl start -o "${toString flags}"'
|
||||
|
||||
# So wait until the server is running.
|
||||
while ! ${run} -c '${postgresql}/bin/pg_ctl status'; do
|
||||
# So wait until the server is up. `pg_ctl status' doesn't
|
||||
# work (apparently, it just checks whether the server is
|
||||
# running), so try to connect with psql.
|
||||
while ! ${postgresql}/bin/psql postgres -c ""; do
|
||||
sleep 1
|
||||
done
|
||||
''; # */
|
||||
|
|
Loading…
Reference in a new issue