* 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
This commit is contained in:
Eelco Dolstra 2012-02-20 13:40:47 +00:00
parent 1770b5a400
commit 7278e37072

View File

@ -21,7 +21,9 @@ let
PidFile = ${pidFile} PidFile = ${pidFile}
DBHost = ${cfg.dbServer} ${optionalString (cfg.dbServer != "localhost") ''
DBHost = ${cfg.dbServer}
''}
DBName = zabbix DBName = zabbix
@ -76,8 +78,7 @@ in
description = "Zabbix server daemon"; description = "Zabbix server daemon";
startOn = if cfg.dbServer == "localhost" then "started postgresql" else "filesystem"; startOn = "filesystem";
stopOn = if cfg.dbServer == "localhost" then "stopping postgresql" else "starting shutdown";
preStart = preStart =
'' ''
@ -94,6 +95,8 @@ in
fi fi
''; '';
path = [ pkgs.nettools ];
# Zabbix doesn't have an option not to daemonize, and doesn't # Zabbix doesn't have an option not to daemonize, and doesn't
# daemonize in a way that allows Upstart to track it. So to # daemonize in a way that allows Upstart to track it. So to
# make sure that we notice when it goes down, we start Zabbix # make sure that we notice when it goes down, we start Zabbix
@ -102,7 +105,6 @@ in
# just monitor `cat'. # just monitor `cat'.
script = script =
'' ''
export PATH=${pkgs.nettools}/bin:$PATH
rm -f ${stateDir}/dummy rm -f ${stateDir}/dummy
mkfifo ${stateDir}/dummy mkfifo ${stateDir}/dummy
cat ${stateDir}/dummy & cat ${stateDir}/dummy &