mirror-health: have systemd restart the service when it dies
authorJulien Cristau <jcristau@debian.org>
Sun, 1 Oct 2017 13:33:36 +0000 (15:33 +0200)
committerJulien Cristau <jcristau@debian.org>
Sun, 1 Oct 2017 13:33:36 +0000 (15:33 +0200)
modules/roles/files/mirror_health/mirror-health
modules/roles/templates/mirror-health.service.erb

index a11c257..49808b3 100755 (executable)
@@ -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)
index 918722f..bf77440 100644 (file)
@@ -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 %>"