Blame SOURCES/0008-mdadm-Update-config-man-regarding-default-files-and-.patch

47b414
From 24e075c659d0a8718aabefe5af4c97195a188af7 Mon Sep 17 00:00:00 2001
47b414
From: Lukasz Florczak <lukasz.florczak@linux.intel.com>
47b414
Date: Fri, 18 Mar 2022 09:26:06 +0100
91179e
Subject: [PATCH 08/83] mdadm: Update config man regarding default files and
47b414
 multi-keyword behavior
47b414
47b414
Simplify default and alternative config file and directory location references
47b414
from mdadm(8) as references to mdadm.conf(5). Add FILE section in config man
47b414
and explain order and conditions in which default and alternative config files
47b414
and directories are used.
47b414
47b414
Update config man behavior regarding parsing order when multiple keywords/config
47b414
files are involved.
47b414
47b414
Signed-off-by: Lukasz Florczak <lukasz.florczak@linux.intel.com>
47b414
Acked-by: Coly Li <colyli@suse.de>
47b414
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
47b414
---
47b414
 mdadm.8.in      | 30 +++++++++--------------
47b414
 mdadm.conf.5.in | 65 ++++++++++++++++++++++++++++++++++++++++++++-----
47b414
 2 files changed, 71 insertions(+), 24 deletions(-)
47b414
47b414
diff --git a/mdadm.8.in b/mdadm.8.in
47b414
index 8b21ffd4..0be02e4a 100644
47b414
--- a/mdadm.8.in
47b414
+++ b/mdadm.8.in
47b414
@@ -266,14 +266,11 @@ the exact meaning of this option in different contexts.
47b414
 
47b414
 .TP
47b414
 .BR \-c ", " \-\-config=
47b414
-Specify the config file or directory.  Default is to use
47b414
-.B {CONFFILE}
47b414
-and
47b414
-.BR {CONFFILE}.d ,
47b414
-or if those are missing then
47b414
-.B {CONFFILE2}
47b414
-and
47b414
-.BR {CONFFILE2}.d .
47b414
+Specify the config file or directory.  If not specified, default config file
47b414
+and default conf.d directory will be used.  See
47b414
+.BR mdadm.conf (5)
47b414
+for more details.
47b414
+
47b414
 If the config file given is
47b414
 .B "partitions"
47b414
 then nothing will be read, but
47b414
@@ -2013,11 +2010,9 @@ The config file is only used if explicitly named with
47b414
 .B \-\-config
47b414
 or requested with (a possibly implicit)
47b414
 .BR \-\-scan .
47b414
-In the later case,
47b414
-.B {CONFFILE}
47b414
-or
47b414
-.B {CONFFILE2}
47b414
-is used.
47b414
+In the later case, default config file is used.  See
47b414
+.BR mdadm.conf (5)
47b414
+for more details.
47b414
 
47b414
 If
47b414
 .B \-\-scan
47b414
@@ -3346,16 +3341,15 @@ on Monitor mode.
47b414
 
47b414
 .SS {CONFFILE} (or {CONFFILE2})
47b414
 
47b414
-The config file lists which devices may be scanned to see if
47b414
-they contain MD super block, and gives identifying information
47b414
-(e.g. UUID) about known MD arrays.  See
47b414
+Default config file.  See
47b414
 .BR mdadm.conf (5)
47b414
 for more details.
47b414
 
47b414
 .SS {CONFFILE}.d (or {CONFFILE2}.d)
47b414
 
47b414
-A directory containing configuration files which are read in lexical
47b414
-order.
47b414
+Default directory containing configuration files.  See
47b414
+.BR mdadm.conf (5)
47b414
+for more details.
47b414
 
47b414
 .SS {MAP_PATH}
47b414
 When
47b414
diff --git a/mdadm.conf.5.in b/mdadm.conf.5.in
47b414
index 83edd008..dd331a6a 100644
47b414
--- a/mdadm.conf.5.in
47b414
+++ b/mdadm.conf.5.in
47b414
@@ -88,7 +88,8 @@ but only the major and minor device numbers.  It scans
47b414
 .I /dev
47b414
 to find the name that matches the numbers.
47b414
 
47b414
-If no DEVICE line is present, then "DEVICE partitions containers" is assumed.
47b414
+If no DEVICE line is present in any config file,
47b414
+then "DEVICE partitions containers" is assumed.
47b414
 
47b414
 For example:
47b414
 .IP
47b414
@@ -272,6 +273,10 @@ catenated with spaces to form the address.
47b414
 Note that this value cannot be set via the
47b414
 .I mdadm
47b414
 commandline.  It is only settable via the config file.
47b414
+There should only be one
47b414
+.B MAILADDR
47b414
+line and it should have only one address.  Any subsequent addresses
47b414
+are silently ignored.
47b414
 
47b414
 .TP
47b414
 .B PROGRAM
47b414
@@ -286,7 +291,8 @@ device.
47b414
 
47b414
 There should only be one
47b414
 .B program
47b414
-line and it should be give only one program.
47b414
+line and it should be given only one program.  Any subsequent programs
47b414
+are silently ignored.
47b414
 
47b414
 
47b414
 .TP
47b414
@@ -295,7 +301,14 @@ The
47b414
 .B create
47b414
 line gives default values to be used when creating arrays, new members
47b414
 of arrays, and device entries for arrays.
47b414
-These include:
47b414
+
47b414
+There should only be one
47b414
+.B create
47b414
+line.  Any subsequent lines will override the previous settings.
47b414
+
47b414
+Keywords used in the
47b414
+.I CREATE
47b414
+line and supported values are:
47b414
 
47b414
 .RS 4
47b414
 .TP
47b414
@@ -475,8 +488,8 @@ The known metadata types are
47b414
 
47b414
 .B AUTO
47b414
 should be given at most once.  Subsequent lines are silently ignored.
47b414
-Thus an earlier config file in a config directory will over-ride
47b414
-the setting in a later config file.
47b414
+Thus a later config file in a config directory will not overwrite
47b414
+the setting in an earlier config file.
47b414
 
47b414
 .TP
47b414
 .B POLICY
47b414
@@ -594,6 +607,7 @@ The
47b414
 line lists custom values of MD device's sysfs attributes which will be
47b414
 stored in sysfs after the array is assembled. Multiple lines are allowed and each
47b414
 line has to contain the uuid or the name of the device to which it relates.
47b414
+Lines are applied in reverse order.
47b414
 .RS 4
47b414
 .TP
47b414
 .B uuid=
47b414
@@ -621,7 +635,46 @@ is running in
47b414
 .B \-\-monitor
47b414
 mode.
47b414
 .B \-d/\-\-delay
47b414
-command line argument takes precedence over the config file
47b414
+command line argument takes precedence over the config file.
47b414
+
47b414
+If multiple
47b414
+.B MINITORDELAY
47b414
+lines are provided, only first non-zero value is considered.
47b414
+
47b414
+.SH FILES
47b414
+
47b414
+.SS {CONFFILE}
47b414
+
47b414
+The default config file location, used when
47b414
+.I mdadm
47b414
+is running without --config option.
47b414
+
47b414
+.SS {CONFFILE}.d
47b414
+
47b414
+The default directory with config files. Used when
47b414
+.I mdadm
47b414
+is running without --config option, after successful reading of the
47b414
+.B {CONFFILE}
47b414
+default config file. Files in that directory
47b414
+are read in lexical order.
47b414
+
47b414
+
47b414
+.SS {CONFFILE2}
47b414
+
47b414
+Alternative config file that is read, when
47b414
+.I mdadm
47b414
+is running without --config option and the
47b414
+.B {CONFFILE}
47b414
+default config file was not opened successfully.
47b414
+
47b414
+.SS {CONFFILE2}.d
47b414
+
47b414
+The alternative directory with config files. Used when
47b414
+.I mdadm
47b414
+is runninng without --config option, after reading the
47b414
+.B {CONFFILE2}
47b414
+alternative config file whether it was successful or not. Files in
47b414
+that directory are read in lexical order.
47b414
 
47b414
 .SH EXAMPLE
47b414
 DEVICE /dev/sd[bcdjkl]1
47b414
-- 
91179e
2.38.1
47b414