From 45156b4057f695733aa9a21bef5f7572c04f71d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Tue, 3 May 2016 22:27:51 +0200 Subject: [PATCH] jenkins service: improve curl call in postStart * Perform HTTP HEAD request instead of full GET (lighter weight) * Don't log output of curl to the journal (it's noise/debug) * Use explicit http:// URL scheme * Reduce poll interval from 10s to 2s (respond to state changes quicker). Probably not relevant on boot (lots of services compete for the CPU), but online service restarts/reloads should be quicker. * Pass --fail to curl (should be more robust against false positives) * Use 4 space indent for shell code. (cherry picked from commit 78b6e8c3199c1ce8ad4744cb90b47e94739083da) --- .../services/continuous-integration/jenkins/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix index 3141ccf4b793..04d3175313d7 100644 --- a/nixos/modules/services/continuous-integration/jenkins/default.nix +++ b/nixos/modules/services/continuous-integration/jenkins/default.nix @@ -164,8 +164,8 @@ in { ''; postStart = '' - until ${pkgs.curl}/bin/curl -s -L ${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} ; do - sleep 10 + until ${pkgs.curl}/bin/curl -s -L --fail --head http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} >/dev/null; do + sleep 2 done '';