Bug#1087584: pidof.8: Some remarks and editorial changes for this man page

Bjarni Ingi Gislason bjarniig at simnet.is
Fri Nov 15 16:01:13 GMT 2024


Package: sysvinit-utils
Version: 3.11-1
Severity: minor
Tags: patch

   * What led up to the situation?

     Checking for defects with

test-[g|n]roff -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z < "man page"

  [Use "groff -e ' $' <file>" to find trailing spaces.]

  ["test-groff" is a script in the repository for "groff"; is not shipped]
(local copy and "troff" slightly changed by me).

  [The fate of "test-nroff" was decided in groff bug #55941.]

   * What was the outcome of this action?


troff: backtrace: file '<stdin>':94
troff:<stdin>:94: warning: trailing space in the line


   * What outcome did you expect instead?

     No output (no warnings).

-.-

  General remarks and further material, if a diff-file exist, are in the
attachments.


-- System Information:
Debian Release: trixie/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.11.5-amd64 (SMP w/2 CPU threads; PREEMPT)
Locale: LANG=is_IS.iso88591, LC_CTYPE=is_IS.iso88591 (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages sysvinit-utils depends on:
ii  libc6  2.40-3

sysvinit-utils recommends no packages.

sysvinit-utils suggests no packages.

-- no debconf information
-------------- next part --------------
  Any program (person), that produces man pages, should check the output
for defects by using (both groff and nroff)

[gn]roff -mandoc -t -ww -b -z -K utf8  <man page>

  The same goes for man pages that are used as an input.

  For a style guide use

  mandoc -T lint

-.-

  So any 'generator' should check its products with the above mentioned
'groff', 'mandoc',  and additionally with 'nroff ...'.

  This is just a simple quality control measure.

  The 'generator' may have to be corrected to get a better man page,
the source file may, and any additional file may.

  Common defects:

  Input text line longer than 80 bytes.

  Not removing trailing spaces (in in- and output).
  The reason for these trailing spaces should be found and eliminated.

  Not beginning each input sentence on a new line.
Lines should thus be shorter.

  See man-pages(7), item 'semantic newline'.

-.-

The difference between the formatted output of the original and patched file
can be seen with:

  nroff -mandoc <file1> > <out1>
  nroff -mandoc <file2> > <out2>
  diff -u <out1> <out2>

and for groff, using

"printf '%s\n%s\n' '.kern 0' '.ss 12 0' | groff -mandoc -Z - "

instead of 'nroff -mandoc'

  Add the option '-t', if the file contains a table.

  Read the output of 'diff -u' with 'less -R' or similar.

-.-.

  If 'man' (man-db) is used to check the manual for warnings,
the following must be set:

  The option "-warnings=w"

  The environmental variable:

export MAN_KEEP_STDERR=yes (or any non-empty value)

  or

  (produce only warnings):

export MANROFFOPT="-ww -b -z"

export MAN_KEEP_STDERR=yes (or any non-empty value)

-.-.

Output from "mandoc -T lint pidof.8": (shortened list)

      4 input text line longer than 80 bytes
      1 whitespace at end of input line

-.-.

Output from "test-groff -mandoc -t -ww -b -z pidof.8": (shortened list)

      1 trailing space in the line

-.-.

Remove space characters at the end of lines.

Use "git apply ... --whitespace=fix" to fix extra space issues, or use
global configuration "core.whitespace".

94:as the program you're after but are actually other programs. Note 

-.-.

Change a HYPHEN-MINUS (code 0x2D) to a minus(-dash) (\-),
if it
is in front of a name for an option,
is a symbol for standard input,
is a single character used to indicate an option,
or is in the NAME section (man-pages(7)).
N.B. - (0x2D), processed as a UTF-8 file, is changed to a hyphen
(0x2010, groff \[u2010] or \[hy]) in the output.

20:pidof - find the process ID of a running program
70:in the uninterruptable state (D), unless the \fB-z\fP flag was specified. This is no
72:whether \fB-z\fP is specified or not.
73:.IP "-d \fIsep\fP"
76:.IP "-o \fIomitpid\fP"

-.-.

Wrong distance between sentences in the input file.

  Separate the sentences and subordinate clauses; each begins on a new
line.  See man-pages(7) ("Conventions for source file layout") and
"info groff" ("Input Conventions").

  The best procedure is to always start a new sentence on a new line,
at least, if you are typing on a computer.

Remember coding: Only one command ("sentence") on each (logical) line.

E-mail: Easier to quote exactly the relevant lines.

Generally: Easier to edit the sentence.

Patches: Less unaffected text.

Search for two adjacent words is easier, when they belong to the same line,
and the same phrase.

  The amount of space between sentences in the output can then be
controlled with the ".ss" request.


38:finds the process id's (PIDs) of the named programs. It prints those
39:id's on the standard output. This program is on some systems used in
41:\fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
42:located in \fI/etc/rc?.d\fP, where ? is the runlevel. If the system has
61:Do not display matched PIDs to standard out. Simply exit with
68:status. Usually these processes are skipped as trying to deal with them can cause
69:pidof or related tools to hang. Note: In the past pidof would ignore processes
70:in the uninterruptable state (D), unless the \fB-z\fP flag was specified. This is no
71:longer the case. The \fBpidof\fP program will find and report processes in the D state
75:is shown. The default separator is a space.
77:Tells \fIpidof\fP to omit processes with that process id. The special
92:should find the pid of, it is reasonably safe. Otherwise it is possible
94:as the program you're after but are actually other programs. Note 

-.-.

Split lines longer than 80 characters into two or more lines.
Appropriate break points are the end of a sentence and a subordinate
clause; after punctuation marks.


Line 68, length 81

status. Usually these processes are skipped as trying to deal with them can cause

Line 70, length 84

in the uninterruptable state (D), unless the \fB-z\fP flag was specified. This is no

Line 71, length 86

longer the case. The \fBpidof\fP program will find and report processes in the D state

Line 101, length 91

The \fB\-z\fP flag (see above) tells \fBpidof\fP to try to detect these sleeping and zombie


-.-.

Use \(en (en-dash) for a dash between space characters,
not a minus (\-) or a hyphen (-), except in the NAME section.

pidof.8:20:pidof - find the process ID of a running program
pidof.8:46:Single shot - this instructs the program to only return one \fIpid\fP.
pidof.8:64:Scripts too - this causes the program to also return process id's of

-.-.

Put a parenthetical sentence, phrase on a separate line,
if not part of a code.
See man-pages(7), item "semantic newline".

pidof.8:99:Zombie processes or processes in disk sleep (states Z and D, respectively)

-.-.

FSF office address update.  See
https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00004.html

16:.\" Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

-.-.

Space after an end of sentence.

11:.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
31:.IR omitpid[,omitpid...]... ]
35:.RI [ program... ]
38:finds the process id's (PIDs) of the named programs. It prints those
39:id's on the standard output. This program is on some systems used in
41:\fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
42:located in \fI/etc/rc?.d\fP, where ? is the runlevel. If the system has
61:Do not display matched PIDs to standard out. Simply exit with
68:status. Usually these processes are skipped as trying to deal with them can cause
69:pidof or related tools to hang. Note: In the past pidof would ignore processes
70:in the uninterruptable state (D), unless the \fB-z\fP flag was specified. This is no
71:longer the case. The \fBpidof\fP program will find and report processes in the D state
75:is shown. The default separator is a space.
77:Tells \fIpidof\fP to omit processes with that process id. The special
92:should find the pid of, it is reasonably safe. Otherwise it is possible
94:as the program you're after but are actually other programs. Note 

-.-.

Output from "test-groff  -mandoc -t -K utf8 -rF0 -rHY=0 -ww -b -z ":

troff: backtrace: file '<stdin>':94
troff:<stdin>:94: warning: trailing space in the line

-.-.

  Additionally (general):

FSF office address update.  See
https://lists.gnu.org/archive/html/bug-gnulib/2024-09/msg00004.html
-------------- next part --------------
--- pidof.8	2024-11-15 12:31:20.457588782 +0000
+++ pidof.8.new	2024-11-15 13:18:35.773161858 +0000
@@ -17,7 +17,7 @@
 .\"
 .TH PIDOF 8 "01 Sep 1998" "sysvinit " "Linux System Administrator's Manual"
 .SH NAME
-pidof - find the process ID of a running program
+pidof \- find the process ID of a running program
 .SH SYNOPSIS
 .B pidof
 .RB [ \-s ]
@@ -26,21 +26,23 @@ pidof - find the process ID of a running
 .RB [ \-x ]
 .RB [ \-z ]
 .RB [ \-o
-.IR omitpid[,omitpid...] ]
+.IR omitpid [ \fB,\fPomitpid "...\&]]"
 .RB [ \-o
-.IR omitpid[,omitpid...]... ]
+.IR omitpid [ \fB,\fPomitpid ...]...\&]
 .RB [ \-d
 .IR sep ]
 .I program
-.RI [ program... ]
+.RI [ program "...]"
 .SH DESCRIPTION
 .B pidof
-finds the process id's (PIDs) of the named programs. It prints those
-id's on the standard output. This program is on some systems used in
-run-level change scripts, especially when the system has a
-\fISystem-V\fP like \fIrc\fP structure. In that case these scripts are
-located in \fI/etc/rc?.d\fP, where ? is the runlevel. If the system has
-a \fBstart-stop-daemon\fP(8) program that should be used instead.
+finds the process id's (PIDs) of the named programs.
+It prints those id's on the standard output.
+This program is on some systems used in run-level change scripts,
+especially when the system has a \fISystem-V\fP like \fIrc\fP structure.
+In that case these scripts are located in \fI/etc/rc?.d\fP,
+where ? is the runlevel.
+If the system has a \fBstart-stop-daemon\fP(8) program
+that should be used instead.
 .SH OPTIONS
 .IP \fB\-s\fP
 Single shot - this instructs the program to only return one \fIpid\fP.
@@ -58,25 +60,31 @@ Instead of using this option the variabl
 .B PIDOF_NETFS
 may be set and exported.
 .IP \fB\-q\fP
-Do not display matched PIDs to standard out. Simply exit with
-a status of true or false to indicate whether a matching PID was found.
+Do not display matched PIDs to standard out.
+Simply exit with a status of true or false to indicate whether a matching
+PID was found.
 .IP \fB\-x\fP
 Scripts too - this causes the program to also return process id's of
 shells running the named scripts.
 .IP \fB\-z\fP
-Try to detect processes which are stuck in zombie (Z)
-status. Usually these processes are skipped as trying to deal with them can cause
-pidof or related tools to hang. Note: In the past pidof would ignore processes
-in the uninterruptable state (D), unless the \fB-z\fP flag was specified. This is no
-longer the case. The \fBpidof\fP program will find and report processes in the D state
-whether \fB-z\fP is specified or not.
-.IP "-d \fIsep\fP"
-Tells \fIpidof\fP to use \fIsep\fP as an output separator if more than one PID
-is shown. The default separator is a space.
-.IP "-o \fIomitpid\fP"
-Tells \fIpidof\fP to omit processes with that process id. The special
-pid \fB%PPID\fP can be used to name the parent process of the \fBpidof\fP
-program, in other words the calling shell or shell script.
+Try to detect processes which are stuck in zombie (Z) status.
+Usually these processes are skipped
+as trying to deal with them can cause pidof or related tools to hang.
+Note: In the past pidof would ignore processes in the uninterruptable state
+(D),
+unless the \fB\-z\fP flag was specified.
+This is no longer the case.
+The \fBpidof\fP program will find and report processes in the D state
+whether \fB\-z\fP is specified or not.
+.IP "\-d \fIsep\fP"
+Tells \fIpidof\fP to use \fIsep\fP as an output separator
+if more than one PID is shown.
+The default separator is a space.
+.IP "\-o \fIomitpid\fP"
+Tells \fIpidof\fP to omit processes with that process id.
+The special pid \fB%PPID\fP can be used to name the parent process of the
+\fBpidof\fP program,
+in other words the calling shell or shell script.
 .SH "EXIT STATUS"
 .TP
 .B 0
@@ -89,17 +97,22 @@ No program was found with the requested
 the program behaves according to the name under which it is called.
 .PP
 When \fBpidof\fP is invoked with a full pathname to the program it
-should find the pid of, it is reasonably safe. Otherwise it is possible
+should find the pid of,
+it is reasonably safe.
+Otherwise it is possible
 that it returns PIDs of running programs that happen to have the same name
-as the program you're after but are actually other programs. Note 
-that the executable name of running processes is calculated with
+as the program you're after but are actually other programs.
+Note that the executable name of running processes is calculated with
 .BR readlink (2),
 so symbolic links to executables will also match.
 .PP
-Zombie processes or processes in disk sleep (states Z and D, respectively)
-are ignored, as attempts to access the stats of these will sometimes fail.
-The \fB\-z\fP flag (see above) tells \fBpidof\fP to try to detect these sleeping and zombie
-processes, at the risk of failing or hanging.
+Zombie processes or processes in disk sleep
+(states Z and D, respectively)
+are ignored,
+as attempts to access the stats of these will sometimes fail.
+The \fB\-z\fP flag (see above) tells \fBpidof\fP to try to detect these
+sleeping and zombie processes,
+at the risk of failing or hanging.
 
 .SH SEE ALSO
 .BR shutdown (8),


More information about the Debian-init-diversity mailing list