]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
systemd: use "Type=simple" for mdcheck services
authorMartin Wilck <mwilck@suse.com>
Wed, 13 Aug 2025 17:28:08 +0000 (19:28 +0200)
committerXiaoNi87 <xni@redhat.com>
Thu, 28 Aug 2025 07:49:34 +0000 (15:49 +0800)
"Type=oneshot" means that systemd considers the unit as started when the
started process exits. But the "mdcheck" script may run for several
hours.  Thus systemd will regard the unit as "activating" all the
time. This can be easily tested by running "systemctl start
mdcheck_start.service" manually. The systemctl command will not finish
until the mdcheck utility has finished or Ctrl-C is typed, which is
broken.

Use "Type=simple" instead.

Signed-off-by: Martin Wilck <mwilck@suse.com>
systemd/mdcheck_continue.service
systemd/mdcheck_start.service

index 70892a1f60182bad226d1092ece1ee0e2e6e4722..cd12db850e423d6481f904da5ec5bb5917dbfb88 100644 (file)
@@ -11,6 +11,6 @@ ConditionPathExistsGlob=/var/lib/mdcheck/MD_UUID_*
 Documentation=man:mdadm(8)
 
 [Service]
-Type=oneshot
+Type=simple
 Environment="MDADM_CHECK_DURATION=6 hours"
 ExecStart=/usr/share/mdadm/mdcheck --continue --duration ${MDADM_CHECK_DURATION}
index fc4fc4388c6c7377395818837e99102b51f025f4..16ba6b67a1ce389e183b5f619975d5098cdc8b5b 100644 (file)
@@ -11,6 +11,6 @@ Wants=mdcheck_continue.timer
 Documentation=man:mdadm(8)
 
 [Service]
-Type=oneshot
+Type=simple
 Environment="MDADM_CHECK_DURATION=6 hours"
 ExecStart=/usr/share/mdadm/mdcheck --duration ${MDADM_CHECK_DURATION}