summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2018-11-27 19:16:21 +0000
committerDomen Kožar <domen@dev.si>2018-11-27 19:16:21 +0000
commitd04fedd71500703e86486f31e4a1b1289fb7c081 (patch)
tree6551295e9bf1456d81fc0d370a0d21b38e5c06ae /nixos
parentb3fb2d5c1c871a3c154037e14fa0815d1d0891ba (diff)
downloadnixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar.gz
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar.bz2
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar.lz
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar.xz
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.tar.zst
nixpkgs-d04fedd71500703e86486f31e4a1b1289fb7c081.zip
postgresql: Enable systemd integration for 9.6+
This allows, finally, proper detection when postgresql is ready to
accept connections. Until now, it was possible that services depending
on postgresql would fail in a race condition trying to connect
to postgresql.
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/databases/postgresql.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix
index f592be0e768..aeab445a998 100644
--- a/nixos/modules/services/databases/postgresql.nix
+++ b/nixos/modules/services/databases/postgresql.nix
@@ -238,6 +238,9 @@ in
             User = "postgres";
             Group = "postgres";
             PermissionsStartOnly = true;
+            Type = if lib.versionAtLeast cfg.package.version "9.6"
+                   then "notify"
+                   else "simple";
 
             # Shut down Postgres using SIGINT ("Fast Shutdown mode").  See
             # http://www.postgresql.org/docs/current/static/server-shutdown.html