From cb95442fc7330b6a7fbaab7b726ec3246980a735 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 31 Aug 2018 12:58:50 +0200 Subject: [PATCH] systemd: set start burst limits Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229 (https://github.com/systemd/systemd/commit/6bf0f408e4833152197fb38fb10a9989c89f3a59) both the old, and new location are accepted by systemd 229 and up, so using the old location to make them work for either version of systemd. StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230 (https://github.com/systemd/systemd/commit/f0367da7d1a61ad698a55d17b5c28ddce0dc265a) both the old, and new name are accepted by systemd 230 and up, so using the old name to make this option work for either version of systemd. Signed-off-by: Sebastiaan van Stijn --- contrib/init/systemd/docker.service | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service index d6527e8a2e..b99640fc82 100644 --- a/contrib/init/systemd/docker.service +++ b/contrib/init/systemd/docker.service @@ -18,6 +18,17 @@ ExecStopPost=/usr/bin/dockerd post-stop TimeoutSec=0 RestartSec=2 Restart=always + +# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229. +# Both the old, and new location are accepted by systemd 229 and up, so using the old location +# to make them work for either version of systemd. +StartLimitBurst=3 + +# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230. +# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make +# this option work for either version of systemd. +StartLimitInterval=60s + # On RPM Based distributions PATH isn't defined so we define it here # /opt/containerd/bin is in front so dockerd grabs the correct runc binary Environment="PATH=/opt/containerd/bin:/sbin:/usr/bin:/usr/local/bin:$PATH"