0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-14 14:10:33 +03:00

nixos/postgresql: move postStart into separate unit

This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.

To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.

Resolves #400018

Co-authored-by: Marcel <me@m4rc3l.de>
This commit is contained in:
Wolfgang Walther 2025-05-02 14:58:46 +02:00
parent c119848700
commit 41c5662cbe
No known key found for this signature in database
GPG key ID: B39893FA5F65CAE1
139 changed files with 391 additions and 424 deletions

View file

@ -328,7 +328,7 @@ in
description = "Zabbix Server";
wantedBy = [ "multi-user.target" ];
after = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.service";
after = optional mysqlLocal "mysql.service" ++ optional pgsqlLocal "postgresql.target";
path = [ "/run/wrappers" ] ++ cfg.extraPackages;
preStart =
@ -374,7 +374,7 @@ in
systemd.services.httpd.after =
optional (config.services.zabbixWeb.enable && mysqlLocal) "mysql.service"
++ optional (config.services.zabbixWeb.enable && pgsqlLocal) "postgresql.service";
++ optional (config.services.zabbixWeb.enable && pgsqlLocal) "postgresql.target";
};