summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2012-08-20 10:37:21 +1000
committerNeilBrown <neilb@suse.de>2012-09-27 16:57:43 +1000
commitc4e96a305fbca4f83ae9f3a81482481524380905 (patch)
tree58964e396a9bab602fa5b7a400e2b067b022029b
parent23084aaa76d9fc3121ff2ab38c04ee9893793e00 (diff)
downloadmdadm-c4e96a305fbca4f83ae9f3a81482481524380905.tar.gz
mdmon: allow --takeover when original was started with --offroot
As --offroot causes ARGV[0] to be changed, we need to be more lenient when checking that the mdmon we are about to kill really is mdmon. i.e. allow name to be "@dmon" instead. Signed-off-by: NeilBrown <neilb@suse.de>
-rw-r--r--mdmon.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdmon.c b/mdmon.c
index 2d0503d..54e1238 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -184,7 +184,11 @@ static void try_kill_monitor(pid_t pid, char *devname, int sock)
buf[sizeof(buf)-1] = 0;
close(fd);
- if (n < 0 || !strstr(buf, "mdmon"))
+ /* Note that if started with --offroot, the name
+ * might be "@dmon"
+ */
+ if (n < 0 || !(strstr(buf, "mdmon") ||
+ strstr(buf, "@dmon")))
return;
kill(pid, SIGTERM);