summaryrefslogtreecommitdiffstats
path: root/mdmon.c
diff options
context:
space:
mode:
authorJes Sorensen <Jes.Sorensen@redhat.com>2013-02-01 16:15:17 +0100
committerNeilBrown <neilb@suse.de>2013-02-05 05:06:47 +0100
commit3e23ba9d7bd3c2a9fbddc286014480672763e563 (patch)
tree71ac8d36f35cd2099b5747da00a3fcc00be33659 /mdmon.c
parentmdadm.conf.5: clarify connection between action=re-add and bitmaps. (diff)
downloadmdadm-3e23ba9d7bd3c2a9fbddc286014480672763e563.tar.xz
mdadm-3e23ba9d7bd3c2a9fbddc286014480672763e563.zip
Remove --offroot argument and default to always setting argv[0] to @
We still allow --offroot to be given - for compatibility with scripts - but ignore it. The whole point of --offroot is to get systemd to not auto-kill mdmon, and we always want that. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdmon.c')
-rw-r--r--mdmon.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/mdmon.c b/mdmon.c
index 5d5ae94e..8720aa53 100644
--- a/mdmon.c
+++ b/mdmon.c
@@ -184,9 +184,6 @@ static void try_kill_monitor(pid_t pid, char *devname, int sock)
buf[sizeof(buf)-1] = 0;
close(fd);
- /* Note that if started with --offroot, the name
- * might be "@dmon"
- */
if (n < 0 || !(strstr(buf, "mdmon") ||
strstr(buf, "@dmon")))
return;
@@ -276,10 +273,6 @@ void usage(void)
" --help -h : This message\n"
" --all : All devices\n"
" --takeover -t : Takeover container\n"
-" --offroot : Set first character of argv[0] to @ to indicate the\n"
-" application was launched from initrd/initramfs and\n"
-" should not be shutdown by systemd as part of the\n"
-" regular shutdown process.\n"
);
exit(2);
}
@@ -303,6 +296,11 @@ int main(int argc, char *argv[])
{NULL, 0, NULL, 0}
};
+ /*
+ * Always change process name to @dmon to avoid systemd killing it
+ */
+ argv[0][0] = '@';
+
while ((opt = getopt_long(argc, argv, "tha", options, NULL)) != -1) {
switch (opt) {
case 'a':
@@ -313,7 +311,7 @@ int main(int argc, char *argv[])
takeover = 1;
break;
case OffRootOpt:
- argv[0][0] = '@';
+ /* silently ignore old option */
break;
case 'h':
default: