All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mdadm/systemd: remove KillMode=none from service file
@ 2022-02-15 13:34 Coly Li
  2022-04-06  6:36 ` Xiao Ni
  2022-07-28  7:55 ` Mariusz Tkaczyk
  0 siblings, 2 replies; 16+ messages in thread
From: Coly Li @ 2022-02-15 13:34 UTC (permalink / raw)
  To: linux-raid
  Cc: Coly Li, Benjamin Brunner, Franck Bui, Jes Sorensen,
	Mariusz Tkaczyk, Neil Brown, Xiao Ni

For mdadm's systemd configuration, current systemd KillMode is "none" in
following service files,
- mdadm-grow-continue@.service
- mdmon@.service

This "none" mode is strongly againsted by systemd developers (see man 5
systemd.kill for "KillMode=" section), and is considering to remove in
future systemd version.

As systemd developer explained in disuccsion, the systemd kill process
is,
1. send the signal specified by KillSignal= to the list of processes (if
   any), TERM is the default
2. wait until either the target of process(es) exit or a timeout expires
3. if the timeout expires send the signal specified by FinalKillSignal=,
   KILL is the default

For "control-group", all remaining processes will receive the SIGTERM
signal (by default) and if there are still processes after a period f
time, they will get the SIGKILL signal.

For "mixed", only the main process will receive the SIGTERM signal, and
if there are still processes after a period of time, all remaining
processes (including the main one) will receive the SIGKILL signal.

From the above comment, currently KillMode=control-group is a proper
kill mode. Since control-gropu is the default kill mode, the fix can be
simply removing KillMode=none line from the service file, then the
default mode will take effect.

Signed-off-by: Coly Li <colyli@suse.de>
Cc: Benjamin Brunner <bbrunner@suse.com>
Cc: Franck Bui <fbui@suse.de>
Cc: Jes Sorensen <jes@trained-monkey.org>
Cc: Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Xiao Ni <xni@redhat.com>
---
 systemd/mdadm-grow-continue@.service | 1 -
 systemd/mdmon@.service               | 1 -
 2 files changed, 2 deletions(-)

diff --git a/systemd/mdadm-grow-continue@.service b/systemd/mdadm-grow-continue@.service
index 5c667d2..9fdc8ec 100644
--- a/systemd/mdadm-grow-continue@.service
+++ b/systemd/mdadm-grow-continue@.service
@@ -14,4 +14,3 @@ ExecStart=BINDIR/mdadm --grow --continue /dev/%I
 StandardInput=null
 StandardOutput=null
 StandardError=null
-KillMode=none
diff --git a/systemd/mdmon@.service b/systemd/mdmon@.service
index 85a3a7c..7753395 100644
--- a/systemd/mdmon@.service
+++ b/systemd/mdmon@.service
@@ -25,4 +25,3 @@ Type=forking
 # it out) and systemd will remove it when transitioning from
 # initramfs to rootfs.
 #PIDFile=/run/mdadm/%I.pid
-KillMode=none
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-10-04 10:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 13:34 [PATCH] mdadm/systemd: remove KillMode=none from service file Coly Li
2022-04-06  6:36 ` Xiao Ni
2022-04-06 13:35   ` Jes Sorensen
2022-07-28  7:55 ` Mariusz Tkaczyk
2022-07-28  8:39   ` Coly Li
2022-07-28  9:01     ` Mariusz Tkaczyk
2022-07-28 10:55       ` Coly Li
2022-07-29  7:55         ` Mariusz Tkaczyk
2022-07-29  1:55   ` NeilBrown
2022-08-02 15:43     ` Mariusz Tkaczyk
2022-08-18 22:00       ` Michal Koutný
2022-08-24  9:52         ` Mariusz Tkaczyk
2022-08-24 12:03           ` Michal Koutný
2022-08-24 12:57             ` Mariusz Tkaczyk
2022-08-29 16:19               ` Michal Koutný
2022-10-04 10:24   ` Mariusz Tkaczyk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.