Bug 134459 - mdadm prints [OK] twice when starting up
Summary: mdadm prints [OK] twice when starting up
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mdadm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Doug Ledford
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-10-03 00:08 UTC by Reuben Farrelly
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-05-16 22:01:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Reuben Farrelly 2004-10-03 00:08:43 UTC
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
returned:

[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:
Always

Steps to Reproduce:
1. Either start or restart mdmonitor

Comment 1 Doug Ledford 2004-10-04 21:39:42 UTC
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 08:37:52 UTC
I emailed Neil Brown (mdadm author) about this and he's what he had to
say:

"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 11:07:11 UTC
mdadm-1.8.0 is now out:

http://www.spinics.net/lists/raid/msg06699.html

One of the new features in this release is:
--pid-file option to declare a file to record the pid in for --monitor
--daemonise

Probably useful for cleaning up this part of the initscript:

    daemon --check mdadm \
        "/bin/bash -c \"mdadm --monitor --scan -f >
/var/run/mdadm/mdadm.pid\""
    # hack: wait for mdadm to die, assume success if it doesn't die
quickly
    usleep 100000
    if [ -s /var/run/mdadm/mdadm.pid -a -d /proc/$(cat
/var/run/mdadm/mdadm.pid)
 ] ; then




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