Bug 134459 - mdadm prints [OK] twice when starting up
mdadm prints [OK] twice when starting up
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Doug Ledford
Depends On:
Blocks: FC4Target
  Show dependency treegraph
Reported: 2004-10-02 20:08 EDT by Reuben Farrelly
Modified: 2007-11-30 17:10 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-16 18:01:39 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Reuben Farrelly 2004-10-02 20:08:43 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.3)
Gecko/20040929 Firefox/0.10.1

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  ]
[root@tornado mdadm-1.6.0]# 

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)

How reproducible:

Steps to Reproduce:
1. Either start or restart mdmonitor
Comment 1 Doug Ledford 2004-10-04 17:39:42 EDT
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.
Comment 2 Reuben Farrelly 2004-10-11 04:37:52 EDT
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:

-f, --daemonise
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
init script.

Comment 3 Reuben Farrelly 2004-11-03 06:07:11 EST
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
    usleep 100000
    if [ -s /var/run/mdadm/mdadm.pid -a -d /proc/$(cat
 ] ; then

Comment 4 Doug Ledford 2005-05-16 18:01:39 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.