Re: [PATCH 6/6] mdmon: allow disabling "@dmon" command name at compile time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 01 Sep 2013 19:20:13 +0200 Martin Wilck <mwilck@xxxxxxxx> 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@xxxxxxx>
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@xxxxxxxx>
Signed-off-by: NeilBrown <neilb@xxxxxxx>

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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux