[Patchew-devel] [PATCH v2 10/11] docker: Unlimited restart of systemd service

Fam Zheng famz at redhat.com
Fri Jul 27 03:59:33 UTC 2018


Sleeping for 60 seconds makes sure we don't hog the machine, and keep
retrying helps us survive transient network issues.

The patch is not tested, I just referenced systemd document for it.

Signed-off-by: Fam Zheng <famz at redhat.com>
---
 scripts/playbooks/templates/docker.service.j2 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/playbooks/templates/docker.service.j2 b/scripts/playbooks/templates/docker.service.j2
index 45d2871..afd5df1 100644
--- a/scripts/playbooks/templates/docker.service.j2
+++ b/scripts/playbooks/templates/docker.service.j2
@@ -2,6 +2,7 @@
 Description=Patchew docker instance control service for {{ instance_name }}
 Requires=docker.service
 After=docker.service
+StartLimitIntervalSec=0
 
 [Service]
 Restart=always
@@ -11,6 +12,7 @@ ExecStart=/usr/bin/docker run --privileged --name {{ instance_name }} \
     -e PATCHEW_DATA_DIR=/data/patchew \
     patchew:{{ instance_name }}
 ExecStop=/usr/bin/docker stop -t 10 {{ instance_name }}
+RestartSec=60
 
 [Install]
 WantedBy=default.target
-- 
2.17.1




More information about the Patchew-devel mailing list