Bug#580825: mdadm: Exit code 1 when running checkarray

GSR gsr.bugs at infernal-iceberg.com
Sun May 9 04:01:02 UTC 2010


Package: mdadm
Version: 3.1.1-1
Severity: normal
Tags: patch

Hi:

I got the same email. But I think I understand why it does that and
have a fix so it stops causing false alarms. It happens because the
cron command tries to run once per month, but only the first sunday
should checks be performed. So the second test in pipeline fails
around 3 weeks per month, ending the pipe with error, when in reality
that error is not a problem. Plausible fix:

[ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -gt 7 ] || /usr/share/mdadm/checkarray --cron --all --quiet

This checks for command availability (as before) and then checks if
day is not in 1-7 (le becomes gt), so for 8 and after it will stop
there with exit code 0 (cron is happy). If that fails (&& becomes ||)
it executes the check and cron gets whatever error code the vital
command returns.

Hope this helps.

GSR
 





More information about the pkg-mdadm-devel mailing list