From 819869cfb2d6c09600d0ac2aa51ace34669af685 Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Sun, 1 Oct 2017 15:33:36 +0200 Subject: [PATCH] mirror-health: have systemd restart the service when it dies --- modules/roles/files/mirror_health/mirror-health | 2 +- modules/roles/templates/mirror-health.service.erb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 %>" -- 2.20.1