Skip to contentSkip to conversation

Improvement of manpages clvmd.8 and blkdeactivate.8

DISCUSSION [email protected] 3 participants 7 messages Nov 15, 2014 – Nov 19, 2014

lore
Share & tools
lore
#0 lore raw

Hello,

Here is a much improved version of blkdeactivate.8 clvmd.8 and manpages. I can update others in the same way if you're interested.

Regards,

Signature · 1 line
St?phane Aulery
#1 lore raw

Improve clvmd.8 manpage and help output

From: St?phane Aulery <[email protected]>

- closer to the recommendation of man-pages (7) if possible
- Add crossrefs
- Sort options and crossrefs
- Fix default timeout (60 secs) of -t
- Fix ambiguities in the use of spaces before values
- Documents -I[auto]

---
 daemons/clvmd/clvmd.c |  16 +++---
 man/clvmd.8.in        | 140 +++++++++++++++++++++++++-------------------------
 2 files changed, 78 insertions(+), 78 deletions(-)
daemons/clvmd/clvmd.c +8 -8
index 0c1cb44..5cd6874 100644
@@ -153,16 +153,11 @@ static if_type_t get_cluster_type(void);
 static void usage(const char *prog, FILE *file)
 {
 	fprintf(file, "Usage: %s [options]\n"
-		"   -V       Show version of clvmd\n"
-		"   -h       Show this help information\n"
+		"   -C       Sets debug level (from -d) on all clvmd instances clusterwide\n"
 		"   -d[n]    Set debug logging (0:none, 1:stderr (implies -f option), 2:syslog)\n"
+		"   -E<uuid> Take this lock uuid as exclusively locked resource (for restart)\n"
 		"   -f       Don't fork, run in the foreground\n"
-		"   -E<lockuuid> Take this lock uuid as exclusively locked resource (for restart)\n"
-		"   -R       Tell all running clvmds in the cluster to reload their device cache\n"
-		"   -S       Restart clvmd, preserving exclusive locks\n"
-		"   -C       Sets debug level (from -d) on all clvmd instances clusterwide\n"
-		"   -t<secs> Command timeout (default 60 seconds)\n"
-		"   -T<secs> Startup timeout (default none)\n"
+		"   -h       Show this help information\n"
 		"   -I<cmgr> Cluster manager (default: auto)\n"
 		"            Available cluster managers: "
 #ifdef USE_COROSYNC
@@ -177,6 +172,11 @@ static void usage(const char *prog, FILE *file)
 #ifdef USE_SINGLENODE
 		"singlenode "
 #endif
+		"   -R       Tell all running clvmds in the cluster to reload their device cache\n"
+		"   -S       Restart clvmd, preserving exclusive locks\n"
+		"   -t<secs> Command timeout (default: 60 seconds)\n"
+		"   -T<secs> Startup timeout (default:  0 seconds)\n"
+		"   -V       Show version of clvmd\n"
 		"\n", prog);
 }
 
man/clvmd.8.in +70 -70

191 lines not on this page · raw message

Signature · 1 line
2.1.3
#2 lore raw

Improve clvmd.8 manpage and help output

In reply to [email protected]

From: St?phane Aulery <[email protected]>

Closer to the recommendation of groff_man (7) if possible

---
 man/clvmd.8.in | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
man/clvmd.8.in +10 -10
index d94d920..f639194 100644
@@ -39,16 +39,16 @@ logging then the command needs to be issued twice, eg:
 .br
 .TP
 .BR "\-d" "[<" "\fIvalue\fP" ">]"
-Set debug logging level. \fIValue\fP can be:
-.br
-0: disabled;
-.br
-1: sends debug logs to stderr (implies \fB\-f\fP);
-.br
-2: sends debug logs to
-.BR syslog "(3).
-.br
-If \fB\-d\fP is specified without a \fIvalue\fP then 1 is assumed.
+Set debug logging level.If \fB\-d\fP is specified without a \fIvalue\fP then 1
+is assumed. \fIValue\fP can be:
+.RS
+.IP \fI0\fP
+Disabled;
+.IP \fI1\fP
+Sends debug logs to stderr (implies \fB\-f\fP);
+.IP \fI2\fP
+Sends debug logs to \fBsyslog\fP(3).
+.RE
 .TP
 .BR "\-E" "<" "\fIlock uuid\fP" ">"
 Pass \fIlock uuid\fP to be reacquired exclusively when \fBclvmd\fP is restarted.
Signature · 1 line
2.1.3
#3 lore raw

Improve blkdeactivate.8 manpage and help output

In reply to [email protected]

From: St?phane Aulery <[email protected]>

- Closer to the recommendation of man-pages and groff_man (7) if possible
- Sort options and crossrefs
- Relocate sub-options on the right places

---
 man/blkdeactivate.8.in | 91 +++++++++++++++++++++++++-------------------------
 1 file changed, 46 insertions(+), 45 deletions(-)
man/blkdeactivate.8.in +46 -45
index bfd0204..69935b5 100644
@@ -2,58 +2,60 @@
 .SH "NAME"
 blkdeactivate \(em utility to deactivate block devices
 .SH SYNOPSIS
-.B blkdeactivate
-.RI [ options ]
-.RI [ device... ]
-.sp
+.SY blkdeactivate
+.OP \-d dm_options
+.OP \-e
+.OP \-h
+.OP \-l lvm_options
+.OP \-u
+.OP \-v
+.RI [ device ]
+.YS
 .SH DESCRIPTION
-blkdeactivate utility deactivates block devices. If a device
-is mounted, the utility can unmount it automatically before
-trying to deactivate. The utility currently supports
-\fIdevice-mapper\fP devices, including \fILVM\fP volumes.
-LVM volumes are handled directly using the \fIlvm\fP command.
-Other device-mapper based devices are handled using the
-\fIdmsetup\fP command.
+.B Blkdeactivate
+utility deactivates block devices. If a device is mounted, the utility can
+unmount it automatically before trying to deactivate. The utility currently
+supports device-mapper devices, including LVM volumes. LVM volumes are handled
+directly using the \fBlvm\fP(8) command. Other device-mapper based devices are
+handled using the \fBdmsetup\fP(8) command.
 .SH OPTIONS
 .TP
+.BR "\-d \fIdm_options\fP", " \-\-dmoption \fIdm_options\fP"
+Comma separated list of device-mapper specific options. \fBDmsetup\fP(8)
+options accepted are :
+.RS
+.IP \fIretry\fP
+Retry removal several times in case of failure;
+.IP \fIforce\fP
+Force device removal.
+.RE
+.TP
 .BR \-e ", " \-\-errors
-Show errors reported from tools called by blkdeactivate.
-Without this option, any error messages from these external tools
-are suppressed and the blkdeactivate itself provides only a summary
-message about device being skipped or not.
+Show errors reported from tools called by \fBblkdeactivate\fP. Without this
+option, any error messages from these external tools are suppressed and the
+\fBblkdeactivate\fP itself provides only a summary message about device being
+skipped or not.
 .TP
 .BR \-h ", " \-\-help
 Display the help text.
 .TP
+.BR "\-l \fIlvm_options\fP", " \-\-lvmoption \fIlvm_options\fP"
+Comma separated list of LVM specific options.
+.RS
+.IP \fIretry\fP
+Retry removal several times in case of failure;
+.IP \fIwholevg\fP
+Deactivate the whole LVM Volume Group when processing a Logical Volume.
+Deactivating Volume Group as a whole takes less time than deactivating each
+Logical Volume separately.
+.RE
+.TP
 .BR \-u ", " \-\-umount
-Unmount a mounted device before trying to deactivate it.
-Without this option used, a device that is mounted is not deactivated.
+Unmount a mounted device before trying to deactivate it. Without this option
+used, a device that is mounted is not deactivated.
 .TP
 .BR \-v ", " \-\-verbose
 Run in verbose mode.
-.TP
-.BR \-d ", " \-\-dmoption " " \fIdm_options
-Comma separated list of device-mapper specific options.
-.TP
-.BR \-l ", " \-\-lvmoption " " \fIlvm_options
-Comma separated list of LVM specific options.
-.SH DM_OPTIONS
-.TP
-.B retry
-Retry removal several times in case of failure.
-.TP
-.B force
-Force device removal. See \fBdmsetup\fP(8) for more information.
-.SH LVM_OPTIONS
-.TP
-.B retry
-Retry removal several times in case of failure.
-.TP
-.B wholevg
-Deactivate the whole LVM Volume Group when processing a Logical Volume.
-Deactivating Volume Group as a whole takes less time than deactivating
-each Logical Volume separately.
-
 .SH EXAMPLES
 .sp
 Deactivate all supported block devices found in the system. If a device
@@ -81,9 +83,8 @@ Deactivate all supported block devices found in the system. Retry deactivation
 of device-mapper devices in case the deactivation fails and force removal.
 .sp
 .B blkdeactivate \-d force,retry
-
 .SH SEE ALSO
-.BR lsblk (8)
-.BR umount (8)
-.BR dmsetup (8)
-.BR lvm (8)
+.BR dmsetup (8),
+.BR lsblk (8),
+.BR lvm (8),
+.BR umount (8).
Signature · 1 line
2.1.3
#4 lore raw
In reply to [email protected]

Dne 15.11.2014 v 17:46 saulery at free.fr napsal(a):

Quoted 6 lines

Hello,

Here is a much improved version of blkdeactivate.8 clvmd.8 and manpages. I can update others in the same way if you're interested.

This patch set has been only partially accepted.

We cannot use .OP groff macro since it's not compatible with older systems (i.e. RHEL5) which do not have them build in and so far we support very wide set of system to compile on.

Also we generally document long option with adding '-x' short cut on the same line - which is likely not fully compliant but yet well readable.

Also I'm not convinced removing space in option list leads to better man page formatting.

So few changes are different from your patches.

Please supply groff error list (ideally with the way how to reproduce) so we could easily see if there is a way to be more consistent yet we could avoid rewriting everything.

We would already have 'generated' man pages - yet noone stepped into this field yet.

Idea is - to use 'single' place for options and doc for option and generate man pages and command line options from it (since current way of hand writing is usually not in the closest touch with source code).

Zdenek

#5 lore raw

Hello Zdenek,

Le mercredi 19 novembre 2014 ? 01:28:46, Zdenek Kabelac a ?crit :

Quoted 6 lines

Dne 15.11.2014 v 17:46 saulery at free.fr napsal(a):

Quoted 4 lines

Here is a much improved version of blkdeactivate.8 clvmd.8 and manpages. I can update others in the same way if you're interested.

Quoted 8 lines

This patch set has been only partially accepted.

We cannot use .OP groff macro since it's not compatible with older systems (i.e. RHEL5) which do not have them build in and so far we support very wide set of system to compile on.

Also we generally document long option with adding '-x' short cut on the same line - which is likely not fully compliant but yet well readable.

Ok. I was not aware of this limitation. Can you use the BSD mdoc format?

Quoted 3 lines

Also I'm not convinced removing space in option list leads to better man page formatting.

On this point, I do not look for better formatting but explain the options usage.According to a case, some have a space, others do not. I thought the text using /daemons/clvmd/clvmd.c (bx example -E).

There is more than one program (I don't for lvm in particular) that mixes options, with and without space. It's inconsistent and crazy.

Quoted 1 line

So few changes are different from your patches.

And I'm not upset. It's good for me.

Quoted 3 lines

Please supply groff error list (ideally with the way how to reproduce) so we could easily see if there is a way to be more consistent yet we could avoid rewriting everything.

You can use this for syntax errors:

$GROFF_ENCODING=utf8 groff -b -ww -z -mandoc mymanpage.8

I don't know any check program for man macros.

For a complete list, see section STYLE GUIDE of "man-pages" manpage.

* Program name must be in bold ;
* Citation of options in text must be in bold ;
* Citation of option arguments in text must be in italic ;
* Any reference to another man page should be written with the name in bold ;
* Entries of SEE ALSO section must be sorted by section number, then by name ;
* Cite short ant long option integrally ;
* Sort options to accelerate research ;
* Be clear (and consistent if possible) with the syntax options ;
* [...]

Then we can argue. I find that these recommendations are generally good. The most important is the general consistency across all pages and fidelity to the behavior of programs, of course.

Quoted 6 lines

We would already have 'generated' man pages - yet noone stepped into this field yet.

Idea is - to use 'single' place for options and doc for option and generate man pages and command line options from it (since current way of hand writing is usually not in the closest touch with source code).

This is a big deal. I do not even know if it's a good idea in the end because even directly in the code, all the explanations of an option can not be found in one place. At best it is possible to generate the overall page structure, but it will still change the rest by hand. It adds a lot of complexity for not guarantee results.

Another solution is literate programming. I doubt you want to rewrite all :-))

Alternatively, you can generate pages from a lightweight markup language for easy maintenance.

Regards,

Signature · 1 line
St?phane Aulery
#6 lore raw

Dne 19.11.2014 v 02:43 St?phane Aulery napsal(a):

Quoted 11 lines

Hello Zdenek,

Le mercredi 19 novembre 2014 ? 01:28:46, Zdenek Kabelac a ?crit :

Quoted 8 lines

Dne 15.11.2014 v 17:46 saulery at free.fr napsal(a):

Quoted 4 lines

Here is a much improved version of blkdeactivate.8 clvmd.8 and manpages. I can update others in the same way if you're interested.

This patch set has been only partially accepted.

Quoted 8 lines
Quoted 6 lines

We cannot use .OP groff macro since it's not compatible with older systems (i.e. RHEL5) which do not have them build in and so far we support very wide set of system to compile on.

Also we generally document long option with adding '-x' short cut on the same line - which is likely not fully compliant but yet well readable.

Ok. I was not aware of this limitation. Can you use the BSD mdoc format?

Maybe there is a way how to provide 'embeded' macro definition with lvm2 code base - so if they are not available in the system - built-in definition from lvm2 would be user ? - something like .m4 macros fro configure - though I'm surely not man-page/groff expert here.

Quoted 4 lines

You can use this for syntax errors:

$GROFF_ENCODING=utf8 groff -b -ww -z -mandoc mymanpage.8

I'll check

Quoted 5 lines

I don't know any check program for man macros.

For a complete list, see section STYLE GUIDE of "man-pages" manpage.

Quoted 9 lines

* Program name must be in bold ;
* Citation of options in text must be in bold ;
* Citation of option arguments in text must be in italic ;
* Any reference to another man page should be written with the name in bold ;
* Entries of SEE ALSO section must be sorted by section number, then by name ;
* Cite short ant long option integrally ;
* Sort options to accelerate research ;
* Be clear (and consistent if possible) with the syntax options ;
* [...]

All those are mostly known and agreed, but there are no hands to change them all and moreover even fix them.

Quoted 11 lines

Then we can argue. I find that these recommendations are generally good. The most important is the general consistency across all pages and fidelity to the behavior of programs, of course.

Quoted 6 lines

We would already have 'generated' man pages - yet noone stepped into this field yet.

Idea is - to use 'single' place for options and doc for option and generate man pages and command line options from it (since current way of hand writing is usually not in the closest touch with source code).

Quoted 8 lines

This is a big deal. I do not even know if it's a good idea in the end because even directly in the code, all the explanations of an option can not be found in one place. At best it is possible to generate the overall page structure, but it will still change the rest by hand. It adds a lot of complexity for not guarantee results.

Another solution is literate programming. I doubt you want to rewrite all :-))

The problem here is - we try to keep 'meaning' of option consistent across commands, but it's often forgotten in which commands the individual option are used - so if the description for an option is fixed in one place, it then still appear in some broken form in other command. Also users tend to be often confused where 'common' options are only described in 'man lvm(8)' and they are missing in the command itself.

So having a single place for option description would make things much easier to maintain.

Maybe there is already some solution for this used in some other projects ?

Regards

Zdenek