Bug 113789 - /etc/rc.d/init.d/mdmonitor can be improved
Summary: /etc/rc.d/init.d/mdmonitor can be improved
Alias: None
Product: Fedora
Classification: Fedora
Component: mdadm   
(Show other bugs)
Version: 1
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Doug Ledford
QA Contact:
Keywords: EasyFix
Depends On:
TreeView+ depends on / blocked
Reported: 2004-01-18 02:02 UTC by Radu Greab
Modified: 2007-11-30 22:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-04-22 22:01:49 UTC
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-18 02:04 UTC, Radu Greab
no flags Details

Description Radu Greab 2004-01-18 02:02:52 UTC
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-18 02:04:15 UTC
Created attachment 97079 [details]
improvement of mdmonitor init script

Comment 2 Warren Togami 2004-02-04 10:12:37 UTC
We will review this... remind me in 10 days if you don't hear anything
from me.

Comment 3 Alexandre Oliva 2004-03-31 05:42:48 UTC
Consider yourself reminded :-)

Comment 4 Warren Togami 2004-03-31 08:09:08 UTC
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 18:04:59 UTC
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 22:01:49 UTC
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.