enum linetype { Devices, Array, Mailaddr, Mailfrom, Program, CreateDev,
Homehost, HomeCluster, AutoMode, Policy, PartPolicy, Sysfs,
- LTEnd };
+ MonitorDelay, LTEnd };
char *keywords[] = {
[Devices] = "devices",
[Array] = "array",
[Policy] = "policy",
[PartPolicy]="part-policy",
[Sysfs] = "sysfs",
+ [MonitorDelay] = "monitordelay",
[LTEnd] = NULL
};
}
}
+static int monitor_delay;
+void monitordelayline(char *line)
+{
+ char *w;
+
+ for (w = dl_next(line); w != line; w = dl_next(w)) {
+ if (monitor_delay == 0)
+ monitor_delay = strtol(w, NULL, 10);
+ }
+}
+
char auto_yes[] = "yes";
char auto_no[] = "no";
char auto_homehost[] = "homehost";
case Sysfs:
sysfsline(line);
break;
+ case MonitorDelay:
+ monitordelayline(line);
+ break;
default:
pr_err("Unknown keyword %s\n", line);
}
return home_cluster;
}
+int conf_get_monitor_delay(void)
+{
+ load_conffile();
+ return monitor_delay;
+}
+
struct createinfo *conf_get_create_info(void)
{
load_conffile();
break;
}
if (c.delay == 0) {
- if (get_linux_version() > 2006016)
- /* mdstat responds to poll */
- c.delay = 1000;
- else
+ c.delay = conf_get_monitor_delay();
+ if (!c.delay)
c.delay = 60;
}
rv = Monitor(devlist, mailaddr, program,
.I POLICY
line and supported values are:
-.RS 7
+.RS 4
.TP
.B domain=
any arbitrary string
.TP
.B SYSFS
-The SYSFS line lists custom values of MD device's sysfs attributes which will be
+The
+.B SYSFS
+line lists custom values of MD device's sysfs attributes which will be
stored in sysfs after the array is assembled. Multiple lines are allowed and each
line has to contain the uuid or the name of the device to which it relates.
.RS 4
when the array was created. It will be ignored if
.B uuid
is not empty.
+.RE
+
.TP
-.RS 7
+.B MONITORDELAY
+The
+.B monitordelay
+line gives a delay in seconds
+.I mdadm
+shall wait before pooling md arrays
+when
+.I mdadm
+is running in
+.B \-\-monitor
+mode.
+.B \-d/\-\-delay
+command line argument takes precedence over the config file
.SH EXAMPLE
DEVICE /dev/sd[bcdjkl]1
.br
SYSFS uuid=bead5eb6:31c17a27:da120ba2:7dfda40d group_thread_cnt=4
sync_speed_max=1000000
+.br
+MONITORDELAY 60
.SH SEE ALSO
.BR mdadm (8),
extern char *conf_get_program(void);
extern char *conf_get_homehost(int *require_homehostp);
extern char *conf_get_homecluster(void);
+extern int conf_get_monitor_delay(void);
extern char *conf_line(FILE *file);
extern char *conf_word(FILE *file, int allow_key);
extern void print_quoted(char *str);