From 7263ae74cd8c80625a3dd04afe290ad1077b3bf9 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 26 May 2025 13:41:59 +0200 Subject: [PATCH] contrib: systemd: update deprecated StartLimit options These were originally added in 7b9ecb9700ebd90c7f5854028f0f981f0fe5d03a. The `StartLimitBurst` and `StartLimitInterval` options used to be options for `[Service]`, but were moved to the `[Unit]` in systemd 229, and systemd 230 respectively. The `StartLimitInterval` was renamed to `StartLimitIntervalSec`, which either takes a number (using "seconds" as default unit) or an optional unit; - https://github.com/systemd/systemd/commit/6bf0f408e4833152197fb38fb10a9989c89f3a59 - https://github.com/systemd/systemd/commit/f0367da7d1a61ad698a55d17b5c28ddce0dc265a We kept these deprecated options to provide compatibility with older distros that not yet had systemd 230, but all distros we support are now on versions of systemd that support the new options; docker run --rm registry.access.redhat.com/ubi8/ubi systemctl --version systemd 239 (239-82.el8_10.5) +PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=legacy docker run -it --rm debian: apt-get update && apt-get install -y systemd ... systemctl --version systemd 247 (247.3-7+deb11u6) +PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +ZSTD +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=unified Signed-off-by: Sebastiaan van Stijn --- contrib/init/systemd/docker.service | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/contrib/init/systemd/docker.service b/contrib/init/systemd/docker.service index 27317fac00..dca6f5c36c 100644 --- a/contrib/init/systemd/docker.service +++ b/contrib/init/systemd/docker.service @@ -4,6 +4,8 @@ Documentation=https://docs.docker.com After=network-online.target nss-lookup.target docker.socket firewalld.service containerd.service time-set.target Wants=network-online.target containerd.service Requires=docker.socket +StartLimitBurst=3 +StartLimitIntervalSec=60 [Service] Type=notify @@ -16,16 +18,6 @@ TimeoutStartSec=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 - # Having non-zero Limit*s causes performance problems due to accounting overhead # in the kernel. We recommend using cgroups to do container-local accounting. LimitNPROC=infinity