]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: mask the mdmonitor.service
authorFrantisek Sumsal <frantisek@sumsal.cz>
Tue, 12 Dec 2023 22:01:31 +0000 (23:01 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Wed, 13 Dec 2023 00:59:20 +0000 (00:59 +0000)
It's pulled in by one of the udev rules (63-md-raid-arrays.rules) and it
fails every time, because there's no valid email address in
/etc/mdadm.conf:

[    5.778153] testsuite-64.sh[403]: mdadm: array /dev/md/mdmirror started.
[    5.819137] kernel: md/raid1:md127: not clean -- starting background reconstruction
[    5.819141] kernel: md/raid1:md127: active with 2 out of 2 mirrors
[    5.819159] kernel: md127: detected capacity change from 0 to 129024
[    5.821950] kernel: md: resync of RAID array md127
...
[    5.887192] mdadm[424]: mdadm: No mail address or alert command - not monitoring.
[    5.890772] systemd[1]: Starting mdmonitor.service...
[    5.891718] systemd[1]: Started mdmonitor.service.
[    5.892570] systemd[1]: mdmonitor.service: Main process exited, code=exited, status=1/FAILURE
[    5.892618] systemd[1]: mdmonitor.service: Failed with result 'exit-code'.

And as we (re)assemble the MD devices multiple times, this gets quite
noisy, especially since we later start hitting the service start rate
limit.

Fedora has the mdmonitor.service patched, so it won't start without
/etc/mdadm.conf being present, but Arch uses the upstream unit which
doesn't have such guard.

Let's just mask the service completely, which replaces all that noise
with one warning:

[    6.553583] testsuite-64.sh[294]: + udevadm wait --settle ...
[    6.580700] systemd[1]: sys-devices-virtual-block-md127.device: Failed to enqueue SYSTEMD_WANTS job, ignoring: Unit mdmonitor.service is masked.

test/units/testsuite-64.sh

index 81edb0ab7a154bf8c50f2a0b3a8f020407d70fb8..0e598cc6b3ec3523673ef1e9d2d44327b7c7b358 100755 (executable)
@@ -1159,6 +1159,10 @@ testcase_mdadm_lvm() {
     helper_check_device_units
 }
 
+# Disable the mdmonitor service, since it fails if there's no valid email address
+# configured in /etc/mdadm.conf, which just unnecessarily pollutes the logs
+systemctl list-unit-files mdmonitor.service >/dev/null && systemctl mask --runtime mdmonitor.service
+
 udevadm settle
 udevadm control --log-level debug
 lsblk -a