From cee4e14bdf7302e48d313264c0c34a418320bba5 Mon Sep 17 00:00:00 2001 From: Pascal Bach Date: Thu, 6 Aug 2020 19:45:14 +0200 Subject: [PATCH] nixos/postgresql: fix setup script The missing () caused parts of the escripts to be added to the ExecStartPost line instead of inside the script. This caused postgresql start to fail under certain conditions. --- 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 59c9325ca90..3e16b5907dd 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -333,7 +333,7 @@ in # Wait for PostgreSQL to be ready to accept connections. ExecStartPost = let - setupScript = pkgs.writeScript "postgresql-setup" '' + setupScript = pkgs.writeScript "postgresql-setup" ('' #!${pkgs.runtimeShell} -e PSQL="${pkgs.utillinux}/bin/runuser -u ${cfg.superUser} -- psql --port=${toString cfg.port}" @@ -360,7 +360,7 @@ in $PSQL -tAc 'GRANT ${permission} ON ${database} TO "${user.name}"' '') user.ensurePermissions)} '') cfg.ensureUsers} - ''; + ''); in "+${setupScript}"; }