diff options
author | NeilBrown <neilb@suse.de> | 2012-08-20 02:37:21 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-20 02:37:21 +0200 |
commit | a99d3469713138f050cccb8657c24a05ffa7057e (patch) | |
tree | ce4ffd9448c2e471bf915aa69f0001cfca0e0ec1 /mdmon.c | |
parent | mdmon: fix arg processing for -a (diff) | |
download | mdadm-a99d3469713138f050cccb8657c24a05ffa7057e.tar.xz mdadm-a99d3469713138f050cccb8657c24a05ffa7057e.zip |
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>
Diffstat (limited to 'mdmon.c')
-rw-r--r-- | mdmon.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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); |