"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>
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}
Documentation=man:mdadm(8)
[Service]
-Type=oneshot
+Type=simple
Environment="MDADM_CHECK_DURATION=6 hours"
ExecStart=/usr/share/mdadm/mdcheck --duration ${MDADM_CHECK_DURATION}