Red Hat Bugzilla – Bug 134459
mdadm prints [OK] twice when starting up
Last modified: 2007-11-30 17:10:50 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3)
Description of problem:
Upon bootup, and when manually starting mdadm using
/etc/init.d/mdmonitor start from the command line, an extra [OK] is
[root@tornado mdadm-1.6.0]# /etc/init.d/mdmonitor start
[ OK ] mdmonitor: [ OK ]
Commenting line 42 of the init.d script: success $"mdadm" out makes
the double instance of [OK] go away (but probably isn't the right fix).
Version-Release number of selected component (if applicable):
mdadm-1.6.0-1 (but this did occur on 1.5 as well)
Steps to Reproduce:
1. Either start or restart mdmonitor
I don't see this, but that's probably due to terminal position
sequences and the two OKs overwriting each other.
In any case, it's not entirely clear what the right thing to do here
is because there are two different things being checked. One is an OK
because the program was successfully started. The other is because
the program stayed started, which is to say that it didn't have any
post fork hiccups.
I inhereted this package with that little startup script oddness, and
I'm not entirely sure if it needs to stay.
I emailed Neil Brown (mdadm author) about this and he's what he had to
"I'm not sure what the actual problem is, but mdadm now has a
"--daemonise" option would could probably be used to remove half of
the ugly code in the script."
man mdadm says:
Tell mdadm to run as a background daemon if it decides to monitor
anything. This causes it to fork and run in the child, and to
disconnect form the terminal. The process id of the child is written
to stdout. This is useful with --scan which will only continue
monitoring if a mail address or alert program is found in the config file.
So maybe this can be used to simplify some of the complexity of the
mdadm-1.8.0 is now out:
One of the new features in this release is:
--pid-file option to declare a file to record the pid in for --monitor
Probably useful for cleaning up this part of the initscript:
daemon --check mdadm \
"/bin/bash -c \"mdadm --monitor --scan -f >
# hack: wait for mdadm to die, assume success if it doesn't die
if [ -s /var/run/mdadm/mdadm.pid -a -d /proc/$(cat
] ; then
Checking in a cleanup to this section of the code now. 1.11.0-4.fc4 and later
will have the new mdmonitor init script.