linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Martin Wilck <mwilck@arcor.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH 6/6] mdmon: allow disabling "@dmon" command name at compile time
Date: Mon, 2 Sep 2013 11:07:03 +1000	[thread overview]
Message-ID: <20130902110703.57cbf68a@notabene.brown> (raw)
In-Reply-To: <5223774D.50405@arcor.de>

[-- Attachment #1: Type: text/plain, Size: 2515 bytes --]

On Sun, 01 Sep 2013 19:20:13 +0200 Martin Wilck <mwilck@arcor.de> wrote:

> On 08/28/2013 07:15 AM, NeilBrown wrote:
> 
> > Can you help me understand?  What is anaconda even looking for mdmon?
> > Does it need exactly "mdmon" or would "@mdmon" be OK?
> 
> To be precise, it's not anaconda but "loader", the C program that starts
> anaconda and cleans up after it. It looks exactly for "mdmon". See
> https://git.fedorahosted.org/cgit/anaconda.git/tree/loader/shutdown.c?h=rhel6-branch#n59
> 
> > Does "started by systemd" mean that "systemctl start mdmon@mdXXX.service" was
> > used to start it?  In that case can't we put something in
> > systemd/mdmon@.service to make the right thing happen?
> 
> Sorry for having explained unclearly. This is *not* a systemd
> environment. There is no regular "init" process running AFAICT, "loader"
> takes that role as far as necessary in the installation environment.
> 
> > 
> > I'm going to hold off on this one for the moment.
> 
> If this isn't applied, in the RHEL/CentOS 6 installation environment,
> "loader" will kill mdmon, and a subsequent "mdadm --wait-clean" will
> hang forever.
> 

Thanks for the details Martin.

I've taken a different approach which should solve the same problem.

If you can confirm that this still works I would appreciate it.

Thanks,
NeilBrown


From 2f1bcf43d93a991845b2ebee76850bd4dc5bc7fc Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 2 Sep 2013 11:02:09 +1000
Subject: [PATCH] Make sure "mdmon" doesn't get called "@dmon".

The Anaconda installer (via its "loader" program) will try to kill
many processes at shutdown, but not "mdmon".

However when mdadm runs mdmon in the Anaconda environment, mdmon
sets argv[0][0] to '@' resulting in "@dmon" which confuses
"loader".

So change mdadm to set argv[0] to a path so that mdmon becomes e.g.
  "@usr/sbin/mdmon"
which "loader" will recognise as being "mdmon".

Reported-by: Martin Wilck <mwilck@arcor.de>
Signed-off-by: NeilBrown <neilb@suse.de>

diff --git a/util.c b/util.c
index 491a107..c12fb21 100644
--- a/util.c
+++ b/util.c
@@ -1691,7 +1691,7 @@ int start_mdmon(char *devnm)
 	char *paths[4] = {
 		pathbuf,
 		"/sbin/mdmon",
-		"mdmon",
+		"./mdmon",
 		NULL
 	};
 
@@ -1759,7 +1759,7 @@ int start_mdmon(char *devnm)
 
 		for (i = 0; paths[i]; i++)
 			if (paths[i][0]) {
-				execl(paths[i], "mdmon",
+				execl(paths[i], paths[i],
 				      devnm, NULL);
 			}
 		exit(1);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

  reply	other threads:[~2013-09-02  1:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-16 18:21 [PATCH 0/6] Fixes for installation of CentOS 6 on DDF BIOS RAID mwilck
2013-08-16 18:21 ` [PATCH 1/6] DDF: ddf_activate_spare: fix gcc -O2 uninitialized warning mwilck
2013-08-28  4:57   ` NeilBrown
2013-08-16 18:21 ` [PATCH 2/6] DDF: export_examine_super_ddf: print MD_DEVICES mwilck
2013-08-16 18:21 ` [PATCH 3/6] DDF: container_content_ddf: set safe_mode_delay > 0 mwilck
2013-08-16 18:21 ` [PATCH 4/6] DDF: increase default value for safe_mode_delay to 4000ms mwilck
2013-08-16 18:21 ` [PATCH 5/6] in_initrd: fix gcc compiler error mwilck
2013-08-28  5:08   ` NeilBrown
2013-08-16 18:22 ` [PATCH 6/6] mdmon: allow disabling "@dmon" command name at compile time mwilck
2013-08-28  5:15   ` NeilBrown
2013-09-01 17:20     ` Martin Wilck
2013-09-02  1:07       ` NeilBrown [this message]
2013-09-02 18:47         ` Martin Wilck
2013-09-02 22:40           ` NeilBrown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130902110703.57cbf68a@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=mwilck@arcor.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).