From 7278e370722fec09a281985c2c1392ee3ea7b007 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 20 Feb 2012 13:40:47 +0000 Subject: [PATCH] * Don't set DBHost if the database is on localhost, otherwise Zabbix will use TCP/IP instead of a Unix domain socket. * Simplify Zabbix's start condition. Zabbix now retries if the database is down instead of bailing out. svn path=/nixos/trunk/; revision=32426 --- modules/services/monitoring/zabbix-server.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/services/monitoring/zabbix-server.nix b/modules/services/monitoring/zabbix-server.nix index f59558e86dd..046c601cb4f 100644 --- a/modules/services/monitoring/zabbix-server.nix +++ b/modules/services/monitoring/zabbix-server.nix @@ -21,7 +21,9 @@ let PidFile = ${pidFile} - DBHost = ${cfg.dbServer} + ${optionalString (cfg.dbServer != "localhost") '' + DBHost = ${cfg.dbServer} + ''} DBName = zabbix @@ -76,8 +78,7 @@ in description = "Zabbix server daemon"; - startOn = if cfg.dbServer == "localhost" then "started postgresql" else "filesystem"; - stopOn = if cfg.dbServer == "localhost" then "stopping postgresql" else "starting shutdown"; + startOn = "filesystem"; preStart = '' @@ -94,6 +95,8 @@ in fi ''; + path = [ pkgs.nettools ]; + # Zabbix doesn't have an option not to daemonize, and doesn't # daemonize in a way that allows Upstart to track it. So to # make sure that we notice when it goes down, we start Zabbix @@ -102,7 +105,6 @@ in # just monitor `cat'. script = '' - export PATH=${pkgs.nettools}/bin:$PATH rm -f ${stateDir}/dummy mkfifo ${stateDir}/dummy cat ${stateDir}/dummy &