Blame SOURCES/020-systemd-unit.patch

f312c6
From e316840a7e1d2a72e3089ee194334244c959905a Mon Sep 17 00:00:00 2001
f312c6
From: Ken Gaillot <kgaillot@redhat.com>
f312c6
Date: Wed, 19 Jan 2022 09:53:53 -0600
f312c6
Subject: [PATCH] Fix: pacemakerd: tweak systemd unit respawn settings
f312c6
f312c6
If pacemaker exits immediately after starting, wait 1 second before trying to
f312c6
respawn, since the default of 100ms is a bit aggressive for a Pacemaker
f312c6
cluster.
f312c6
f312c6
Also, allow 5 attempts in 25 seconds before giving up.
f312c6
---
f312c6
 daemons/pacemakerd/pacemaker.service.in | 6 ++++++
f312c6
 1 file changed, 6 insertions(+)
f312c6
f312c6
diff --git a/daemons/pacemakerd/pacemaker.service.in b/daemons/pacemakerd/pacemaker.service.in
f312c6
index 0363a2259c..3fd53d9ffb 100644
f312c6
--- a/daemons/pacemakerd/pacemaker.service.in
f312c6
+++ b/daemons/pacemakerd/pacemaker.service.in
f312c6
@@ -31,6 +31,9 @@ After=rsyslog.service
f312c6
 After=corosync.service
f312c6
 Requires=corosync.service
f312c6
 
f312c6
+# If Pacemaker respawns repeatedly, give up after this many tries in this time
f312c6
+StartLimitBurst=5
f312c6
+StartLimitIntervalSec=25s
f312c6
 
f312c6
 [Install]
f312c6
 WantedBy=multi-user.target
f312c6
@@ -57,6 +60,9 @@ TasksMax=infinity
f312c6
 # resource.  Sending -KILL will just get the node fenced
f312c6
 SendSIGKILL=no
f312c6
 
f312c6
+# Systemd's default of respawning a failed service after 100ms is too aggressive
f312c6
+RestartSec=1s
f312c6
+
f312c6
 # If we ever hit the StartLimitInterval/StartLimitBurst limit, and the
f312c6
 # admin wants to stop the cluster while pacemakerd is not running, it
f312c6
 # might be a good idea to enable the ExecStopPost directive below.
f312c6
-- 
f312c6
2.27.0
f312c6