diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2012-01-25 15:18:04 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-01-30 02:11:29 +0100 |
commit | a0963a86e12a55d501f421048bd7c09cf4d78b93 (patch) | |
tree | 6765c15881d7fb365b46c03c83f69bf2411208f9 /util.c | |
parent | Add --offroot argument to mdmon (diff) | |
download | mdadm-a0963a86e12a55d501f421048bd7c09cf4d78b93.tar.xz mdadm-a0963a86e12a55d501f421048bd7c09cf4d78b93.zip |
Spawn mdmon with --offroot if mdadm was launched with --offroot
Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -32,6 +32,8 @@ #include <dirent.h> #include <signal.h> +int __offroot; + /* * following taken from linux/blkpg.h because they aren't * anywhere else and it isn't safe to #include linux/ * stuff. @@ -1622,10 +1624,17 @@ int start_mdmon(int devnum) skipped = 0; for (i=0; paths[i]; i++) - if (paths[i][0]) - execl(paths[i], "mdmon", - devnum2devname(devnum), - NULL); + if (paths[i][0]) { + if (__offroot) { + execl(paths[i], "mdmon", "--offroot", + devnum2devname(devnum), + NULL); + } else { + execl(paths[i], "mdmon", + devnum2devname(devnum), + NULL); + } + } exit(1); case -1: fprintf(stderr, Name ": cannot run mdmon. " "Array remains readonly\n"); |