Blame SOURCES/0012-mdadm-systemd-remove-KillMode-none-from-service-file.patch

47b414
From 52c67fcdd6dadc4138ecad73e65599551804d445 Mon Sep 17 00:00:00 2001
47b414
From: Coly Li <colyli@suse.de>
47b414
Date: Tue, 15 Feb 2022 21:34:15 +0800
47b414
Subject: [PATCH 12/12] mdadm/systemd: remove KillMode=none from service file
47b414
47b414
For mdadm's systemd configuration, current systemd KillMode is "none" in
47b414
following service files,
47b414
- mdadm-grow-continue@.service
47b414
- mdmon@.service
47b414
47b414
This "none" mode is strongly againsted by systemd developers (see man 5
47b414
systemd.kill for "KillMode=" section), and is considering to remove in
47b414
future systemd version.
47b414
47b414
As systemd developer explained in disuccsion, the systemd kill process
47b414
is,
47b414
1. send the signal specified by KillSignal= to the list of processes (if
47b414
   any), TERM is the default
47b414
2. wait until either the target of process(es) exit or a timeout expires
47b414
3. if the timeout expires send the signal specified by FinalKillSignal=,
47b414
   KILL is the default
47b414
47b414
For "control-group", all remaining processes will receive the SIGTERM
47b414
signal (by default) and if there are still processes after a period f
47b414
time, they will get the SIGKILL signal.
47b414
47b414
For "mixed", only the main process will receive the SIGTERM signal, and
47b414
if there are still processes after a period of time, all remaining
47b414
processes (including the main one) will receive the SIGKILL signal.
47b414
47b414
From the above comment, currently KillMode=control-group is a proper
47b414
kill mode. Since control-gropu is the default kill mode, the fix can be
47b414
simply removing KillMode=none line from the service file, then the
47b414
default mode will take effect.
47b414
47b414
Signed-off-by: Coly Li <colyli@suse.de>
47b414
Cc: Benjamin Brunner <bbrunner@suse.com>
47b414
Cc: Franck Bui <fbui@suse.de>
47b414
Cc: Jes Sorensen <jes@trained-monkey.org>
47b414
Cc: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
47b414
Cc: Neil Brown <neilb@suse.de>
47b414
Cc: Xiao Ni <xni@redhat.com>
47b414
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
47b414
---
47b414
 systemd/mdadm-grow-continue@.service | 1 -
47b414
 systemd/mdmon@.service               | 1 -
47b414
 2 files changed, 2 deletions(-)
47b414
47b414
diff --git a/systemd/mdadm-grow-continue@.service b/systemd/mdadm-grow-continue@.service
47b414
index 5c667d2a..9fdc8ec7 100644
47b414
--- a/systemd/mdadm-grow-continue@.service
47b414
+++ b/systemd/mdadm-grow-continue@.service
47b414
@@ -14,4 +14,3 @@ ExecStart=BINDIR/mdadm --grow --continue /dev/%I
47b414
 StandardInput=null
47b414
 StandardOutput=null
47b414
 StandardError=null
47b414
-KillMode=none
47b414
diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service
47b414
index 85a3a7c5..77533958 100644
47b414
--- a/systemd/mdmon@.service
47b414
+++ b/systemd/mdmon@.service
47b414
@@ -25,4 +25,3 @@ Type=forking
47b414
 # it out) and systemd will remove it when transitioning from
47b414
 # initramfs to rootfs.
47b414
 #PIDFile=/run/mdadm/%I.pid
47b414
-KillMode=none
47b414
-- 
47b414
2.31.1
47b414