From fb8af2f9b6081338b4a2e2b0c850aba108044897 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 19 Dec 2012 12:59:28 +0100 Subject: [PATCH] postgresql: Don't wait for ages in post-start if the service has failed --- modules/services/databases/postgresql.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/services/databases/postgresql.nix b/modules/services/databases/postgresql.nix index a013a3ccc3d6..c178a84b1b85 100644 --- a/modules/services/databases/postgresql.nix +++ b/modules/services/databases/postgresql.nix @@ -199,7 +199,8 @@ in # Wait for PostgreSQL to be ready to accept connections. postStart = '' - while ! psql postgres -c ""; do + while ! psql postgres -c "" 2> /dev/null; do + if ! kill -0 "$MAINPID"; then exit 1; fi sleep 0.1 done '';