Bug 113789 - /etc/rc.d/init.d/mdmonitor can be improved
/etc/rc.d/init.d/mdmonitor can be improved
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Doug Ledford
: EasyFix
Depends On:
  Show dependency treegraph
Reported: 2004-01-17 21:02 EST by Radu Greab
Modified: 2007-11-30 17:10 EST (History)
1 user (show)

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

Attachments (Terms of Use)
improvement of mdmonitor init script (1.32 KB, text/plain)
2004-01-17 21:04 EST, Radu Greab
no flags Details

  None (edit)
Description Radu Greab 2004-01-17 21:02:52 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1)

Description of problem:
/etc/rc.d/init.d/mdmonitor uses a hack to start mdadm. I found that
mdadm can be started in the standard way, with daemon(), initlog etc.
So I made a patch for the init script, which maybe will help if the
errata for #112490 does not already have an improvement:

daemon --check mdadm \
  "/bin/bash -c \"mdadm --monitor --scan -f > /var/run/mdadm.pid\""

mdadm in monitor mode will run in background if argument -f or
--daemonise is given.

Although mdadm(8) man page says "Also  write pid of mdadm daemon to
/var/run/mdadm.", I did not see this happening. The man page also says
and this is true: in daemon mode mdadm will write the pid of the
daemon on stdout. With an extra shell invocation and a redirection I
managed to write this pid to /var/run/mdadm.pid. One possible problem:
if mdadm refuses to start or become a daemon, then /var/run/mdadm.pid
will be created as a zero size file. If this is a problem, then the
script could check the size and delete the file.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Review /etc/rc.d/init.d/mdmonitor
2. service mdmonitor start and see the odd output format.

Additional info:
Comment 1 Radu Greab 2004-01-17 21:04:15 EST
Created attachment 97079 [details]
improvement of mdmonitor init script
Comment 2 Warren Togami 2004-02-04 05:12:37 EST
We will review this... remind me in 10 days if you don't hear anything
from me.
Comment 3 Alexandre Oliva 2004-03-31 00:42:48 EST
Consider yourself reminded :-)
Comment 4 Warren Togami 2004-03-31 03:09:08 EST
Took a quick look.  The FC2 initscript changed a bit from FC1, but
aside from that I am uncertain about the behavior of the kernel side
enough to determine if removing the ugly sleep hack is safe or not.  I
would recommend raising this on f-d-l.
Comment 5 Radu Greab 2004-03-31 13:04:59 EST
mdmonitor initscript is really the same in FC1 and FC2 test2, probably
you looked at the new mdmpd initscript. The comment before the sleep
says that it's there to give mdadm a chance to start and decide if it
should die due to some errors or continue to run in monitor mode.
Comment 6 Doug Ledford 2004-04-22 18:01:49 EDT
This should show up in the 1.5.0-4 version of the package.

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