.SH SYNOPSIS
-.BI mdmon " [--all] [--takeover] CONTAINER"
+.BI mdmon " [--all] [--takeover] [--foreground] CONTAINER"
.SH OVERVIEW
The 2.6.27 kernel brings the ability to support external metadata arrays.
device to monitor. It can be a full path like /dev/md/container, or a
simple md device name like md127.
.TP
+.B \-\-foreground
+Normally,
+.I mdmon
+will fork and continue in the background. Adding this option will
+skip that step and run
+.I mdmon
+in the foreground.
+.TP
.B \-\-takeover
This instructs
.I mdmon
int opt;
int all = 0;
int takeover = 0;
+ int dofork = 1;
static struct option options[] = {
{"all", 0, NULL, 'a'},
{"takeover", 0, NULL, 't'},
{"help", 0, NULL, 'h'},
{"offroot", 0, NULL, OffRootOpt},
+ {"foreground", 0, NULL, 'F'},
{NULL, 0, NULL, 0}
};
*/
argv[0][0] = '@';
- while ((opt = getopt_long(argc, argv, "tha", options, NULL)) != -1) {
+ while ((opt = getopt_long(argc, argv, "thaF", options, NULL)) != -1) {
switch (opt) {
case 'a':
container_name = argv[optind-1];
case 't':
takeover = 1;
break;
+ case 'F':
+ dofork = 0;
+ break;
case OffRootOpt:
/* silently ignore old option */
break;
container_name);
exit(1);
}
- return mdmon(devname, devnum, do_fork(), takeover);
+ return mdmon(devname, devnum, dofork && do_fork(), takeover);
}
static int mdmon(char *devname, int devnum, int must_fork, int takeover)