From bc36c7ddd03702ed10d2c1f4ff556a72f6d86d63 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Fri, 29 May 2015 12:16:04 -0400 Subject: [PATCH] hydra-module: Don't assume hydra is running on localhost. In the long run we should add retry logic to hydra-init... --- hydra-module.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hydra-module.nix b/hydra-module.nix index 00f3e439..1a9c5b2e 100644 --- a/hydra-module.nix +++ b/hydra-module.nix @@ -186,8 +186,6 @@ in systemd.services."hydra-init" = { wantedBy = [ "multi-user.target" ]; - requires = [ "postgresql.service" ]; - after = [ "postgresql.service" ]; environment = env; preStart = '' mkdir -m 0700 -p ${baseDir}/data @@ -206,7 +204,10 @@ in serviceConfig.User = "hydra"; serviceConfig.Type = "oneshot"; serviceConfig.RemainAfterExit = true; - }; + } // (optionalAttrs (cfg.dbi == "dbi:Pg:dbname=hydra;user=hydra;") { + requires = [ "postgresql.service" ]; + after = [ "postgresql.service" ]; + }); systemd.services."hydra-server" = { wantedBy = [ "multi-user.target" ];