From 7809134e29c621d621f28f79c19744377d41b20b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 3 Dec 2013 11:35:57 -0500 Subject: [PATCH] postgresql: Fix shutdown Postgres was taking a long time to shutdown. This is because we were sending SIGINT to all processes, apparently confusing the autovacuum launcher. Instead it should only be sent to the main process (which takes care of shutting down the others). The downside is that systemd will also send the final SIGKILL only to the main process, so other processes in the cgroup may be left behind. There should be an option for this... --- nixos/modules/services/databases/postgresql.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/databases/postgresql.nix b/nixos/modules/services/databases/postgresql.nix index d99ad2c9c7c2..1563858887e6 100644 --- a/nixos/modules/services/databases/postgresql.nix +++ b/nixos/modules/services/databases/postgresql.nix @@ -211,6 +211,7 @@ in # Shut down Postgres using SIGINT ("Fast Shutdown mode"). See # http://www.postgresql.org/docs/current/static/server-shutdown.html KillSignal = "SIGINT"; + KillMode = "process"; # FIXME: this may cause processes to be left behind in the cgroup even after the final SIGKILL # Give Postgres a decent amount of time to clean up after # receiving systemd's SIGINT.