Blame SOURCES/020-systemd-unit.patch

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