Public bug reported:

[ Impact ]

Scheduled array scrubs don't happen, which (obviously) has potentially
serious consequences.

[ Test plan ]

* lxc launch ubuntu:resolute mdtest --vm -c limits.cpu=4 -c limits.memory=8GiB
* lxc shell mdtest
* apt update && apt install mdadm
* fallocate -l 1G disk1
* fallocate -l 1G disk2
* losetup --find --show disk1  # note the /dev/loopX device
* losetup --find --show disk2  # note the /dev/loopY device
* mdadm --create -n 2 -l raid1 -e 1.2 /dev/md0 /dev/loopX /dev/loopY
* /usr/share/mdadm/mdcheck --start
* Note failure due to unknown "BINDIR" reference
* Enable proposed sources
* apt install -t resolute-proposed mdadm
* /usr/share/mdadm/mdcheck --start
* echo $?
* Note success

[ Where things could go wrong ]

The change only affects mdcheck, so we can limit testing to that binary.
Thankfully the error means that mdcheck fails in a pretty fundamental
way: it doesn't work at all, so regressing further is difficult. The
test case covers checking that the existing version fails as expected,
and the proposed version at least *starts*. There is a risk that it
doesn't *finish*, or that this exposes further errors in mdcheck, but
given the current situation would be hiding those errors that is still
preferable.

[ Original description ]

In the resolute versions of mdadm, the mdcheck script doesn't work due
to BINDIR (a template which is meant to be substituted during package
build) being present in the binary package. This is due to mdcheck being
mentioned in the debian/mdadm.install file which causes dh_install to
copy the *un-substituted* version straight from the source, rather than
the version with the BINDIR substitution which is already output by the
Makefile.

This bug was fixed in stonking, and wasn't present in focal or jammy
(I've recently installed a new server on resolute and noticed mdcheck
was failing to run array scrubs...). This bug has actually been around
since noble (which also incorrectly installs mdcheck straight from
source rather than the build output), but wasn't noticed because mdcheck
didn't include any BINDIR references.

** Affects: mdadm (Ubuntu)
     Importance: Undecided
         Status: Fix Released

** Affects: mdadm (Ubuntu Resolute)
     Importance: High
     Assignee: Dave Jones (waveform)
         Status: Confirmed

** Also affects: mdadm (Ubuntu Resolute)
   Importance: Undecided
       Status: New

** Changed in: mdadm (Ubuntu)
       Status: New => Fix Released

** Changed in: mdadm (Ubuntu Resolute)
       Status: New => Confirmed

** Changed in: mdadm (Ubuntu Resolute)
   Importance: Undecided => High

** Changed in: mdadm (Ubuntu Resolute)
     Assignee: (unassigned) => Dave Jones (waveform)

** Changed in: mdadm (Ubuntu Resolute)
    Milestone: None => ubuntu-26.04.1

** Changed in: mdadm (Ubuntu Resolute)
    Milestone: ubuntu-26.04.1 => resolute-updates

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2162687

Title:
  [SRU] Fix missing template substitution in mdcheck

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mdadm/+bug/2162687/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to