cron. Mail about mdadm

I am receiving mail like the following:

Message  1:
From root@linux.site  Sat Oct 25 02:31:56 2014
X-Original-To: root
Delivered-To: root@linux.site
From: "(Cron Daemon)" <root@linux.site>
To: root@linux.site
Subject: Cron <root@linux> source /etc/sysconfig/mdadm;  -n "$MDADM_CHECK_DURATION" -a -x /usr/share/mdadm/mdcheck ] && /usr/share/mdadm/mdcheck --continue --duration "$MDADM_CHECK_DURATION"
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=14>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0>
X-Cron-Env: <LANG=POSIX>
X-Cron-Env: <LC_CTYPE=en_GB.UTF-8>
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <PATH=/usr/bin:/bin>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Date: Sat, 25 Oct 2014 02:31:56 +0100 (BST)

ls: cannot access /dev/md?*: No such file or directory

I do not have any cron jobs set, AFAIK, nor do I have any RAID devices. Why is this error mail being generated, and should I stop it? If so, how do I go about that?

I’m getting that every day.

I JHD (Just Hit Delete).

I seem to recall that this has been reported as a bug. Hopefully it will be fixed sometime.

I am not expecting any factory bug fixes or updates until after 13.2 has been released. I expect that the team is pretty busy with finalizing 13.2 at present.

On 2014-10-28 13:36, nrickert wrote:
>
> I’m getting that every day.

Guessing. Run “rcmdadmd status”. If running, stop and disable it,
provided you are sure you do not have raids. And make a note of the
change in your personal log.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)


rcmdadmd: Command not found.

It looks as if “/etc/cron.daily/mdadm” is the problem. I could probably just delete it (or move it to a different directory).

On 2014-10-28 14:56, nrickert wrote:

> It looks as if “/etc/cron.daily/mdadm” is the problem. I could probably
> just delete it (or move it to a different directory).

Could you post or upload the script somewhere, so that we can have a
look and compare with the 13.1 version?

I don’t have factory installed yet, sorry.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Here is the cron… /etc/cron.daily/mdadm
http://pastebin.com/Z1gSTaAG

And the /etc/sysconfig/mdadm

http://pastebin.com/zFUFTA1i

I am probably too late for help, but just to wrap it off and facilitate it for other people stumbling upon the same problem (like I did, too, with openSUSE 13.2 and no RAID).

The error originates from the call to /usr/share/mdadm/mdcheck from /etc/cron.d/mdadm.

/usr/share/mdadm/mdcheck contains a for-loop starting as follows:

for dev in /dev/md?*

When the glob does not match because no md-devices are present, it will (unless the nullglob shell option is set) expand to the literal “dev/md?*”, resulting in the error seen.

Following http://stackoverflow.com/questions/2937407/test-whether-a-glob-has-any-matches-in-bash, a fix could be

test -n "$(shopt -s nullglob; echo /dev/md?)" && for dev in /dev/md?

The bug has been reported (not by me) and a fix submitted by the mdadm-author, see http://bugzilla.opensuse.org/show_bug.cgi?id=903051 and https://build.opensuse.org/package/view_file/Base:System/mdadm/mdcheck-no-devices.fix?rev=124