mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-30 23:34:12 +03:00
zabbix-server: Make it easier to use peer auth.
Quoting from the manual about DBHost: ``` In case of MySQL localhost or empty string results in using a socket. In case of PostgreSQL only empty string results in attempt to use socket. ``` https://www.zabbix.com/documentation/2.0/manual/appendix/config/zabbix_server With this commit we should avoid some race conditions in systemd, because if the host is set to "", there is no condition that postgresql has to be started prior to the Zabbix server. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
parent
a5c6a36466
commit
62d5282602
@ -34,6 +34,8 @@ let
|
||||
''}
|
||||
'';
|
||||
|
||||
useLocalPostgres = cfg.dbServer == "localhost" || cfg.dbServer == "";
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@ -51,7 +53,10 @@ in
|
||||
|
||||
services.zabbixServer.dbServer = mkOption {
|
||||
default = "localhost";
|
||||
description = "Hostname or IP address of the database server.";
|
||||
description = ''
|
||||
Hostname or IP address of the database server.
|
||||
Use an empty string ("") to use peer authentication.
|
||||
'';
|
||||
};
|
||||
|
||||
services.zabbixServer.dbPassword = mkOption {
|
||||
@ -65,7 +70,7 @@ in
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.postgresql.enable = cfg.dbServer == "localhost";
|
||||
services.postgresql.enable = useLocalPostgres;
|
||||
|
||||
users.extraUsers = singleton
|
||||
{ name = "zabbix";
|
||||
@ -77,7 +82,7 @@ in
|
||||
{ description = "Zabbix Server";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = optional (cfg.dbServer == "localhost") "postgresql.service";
|
||||
after = optional useLocalPostgres "postgresql.service";
|
||||
|
||||
preStart =
|
||||
''
|
||||
|
Loading…
Reference in New Issue
Block a user