From: Julien Cristau Date: Sun, 1 Oct 2017 13:33:36 +0000 (+0200) Subject: mirror-health: have systemd restart the service when it dies X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=819869cfb2d6c09600d0ac2aa51ace34669af685;p=mirror%2Fdsa-puppet.git mirror-health: have systemd restart the service when it dies --- diff --git a/modules/roles/files/mirror_health/mirror-health b/modules/roles/files/mirror_health/mirror-health index a11c2570d..49808b316 100755 --- a/modules/roles/files/mirror_health/mirror-health +++ b/modules/roles/files/mirror_health/mirror-health @@ -44,7 +44,7 @@ def check_uptodate(): logging.debug("lm for host %s: %s", host, lm) if lm > latest_ts: latest_ts = lm - except requests.exceptions.ProxyError: + except (requests.exceptions.ProxyError, requests.exceptions.ReadTimeout): pass local_lm = last_modified(retrieve_from_host('localhost', URL)) logging.debug("lm for localhost: %s", local_lm) diff --git a/modules/roles/templates/mirror-health.service.erb b/modules/roles/templates/mirror-health.service.erb index 918722fd3..bf774406d 100644 --- a/modules/roles/templates/mirror-health.service.erb +++ b/modules/roles/templates/mirror-health.service.erb @@ -14,6 +14,7 @@ ProtectHome=read-only PrivateTmp=true User=nobody Group=nogroup +Restart=always Environment="MIRROR_CHECK_SERVICE=<%= @check_service %>" Environment="MIRROR_CHECK_URL=<%= @url %>"