From eb7bbb486283824da630212af4e9d514d44f88bd Mon Sep 17 00:00:00 2001 From: Tino Breddin Date: Sat, 27 Sep 2014 14:37:11 +0200 Subject: [PATCH] postgresql: use configured port when invoking psql --- nixos/modules/services/databases/postgresql.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index 01c55479b2b..de14c56f797 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -225,14 +225,14 @@ in # Wait for PostgreSQL to be ready to accept connections. postStart = '' - while ! psql postgres -c "" 2> /dev/null; do + while ! psql --port=${toString cfg.port} postgres -c "" 2> /dev/null; do if ! kill -0 "$MAINPID"; then exit 1; fi sleep 0.1 done if test -e "${cfg.dataDir}/.first_startup"; then ${optionalString (cfg.initialScript != null) '' - cat "${cfg.initialScript}" | psql postgres + cat "${cfg.initialScript}" | psql --port=${toString cfg.port} postgres ''} rm -f "${cfg.dataDir}/.first_startup" fi