Commit Graph

77 Commits

Author SHA1 Message Date
Michael Kerrisk (man-pages) cbb38bfbdf Manual pages: logger.1: minor formatting and typo fixes
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-07-24 14:41:49 +02:00
Bjarni Ingi Gislason 8292383df7 doc: misc-utils/*: Fix some warnings from "mandoc -T lint"
mandoc: ./misc-utils/cal.1:214:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/cal.1:216:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/cal.1:225:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/findfs.8:36:2: WARNING: skipping paragraph macro: br after sp
mandoc: ./misc-utils/findfs.8:38:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:41:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:44:2: WARNING: skipping paragraph macro: br before sp
mandoc: ./misc-utils/findfs.8:48:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/logger.1:118:15: STYLE: unterminated quoted argument
mandoc: ./misc-utils/logger.1:231:2: WARNING: skipping paragraph macro: IP empty

mandoc: ./misc-utils/look.1:116:2: STYLE: fill mode already disabled, skipping: nf

mandoc: ./misc-utils/hardlink.1:1:5: STYLE: lower case character in document title: TH hardlink
mandoc: ./misc-utils/hardlink.1:1:2: WARNING: missing date, using today's date: TH
mandoc: ./misc-utils/hardlink.1:9:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:52:2: WARNING: skipping paragraph macro: PP after SH
mandoc: ./misc-utils/hardlink.1:65:2: WARNING: skipping paragraph macro: PP after SH

mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:65:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:97:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:107:2: WARNING: skipping paragraph macro: PP empty
mandoc: ./misc-utils/rename.1:116:2: WARNING: skipping paragraph macro: PP empty

mandoc: ./misc-utils/whereis.1:82:2: WARNING: line scope broken: IP breaks TP
mandoc: ./misc-utils/whereis.1:152:2: WARNING: skipping paragraph macro: PP empty

####

  There is no change in the ouput of "nroff" or "groff", except for

1) a very long line in "logger.1".

2) '-' changed to '\-' for a option in "logger.1".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2020-06-15 11:28:01 +02:00
Michael Kerrisk (man-pages) 3bc92f313a Manual pages: rename EXAMPLE section to EXAMPLES
Earlier, I patched various pages to consistently use EXAMPLE as a
section heading, rather than EXAMPLES.  (At that time, both headings
occurred in util-linux, with roughly equal frequency.)

Since then, I've observed that EXAMPLES is the more common usage
across a large corpus of manual pages. So, in Linux the man-pages
project, I switched to using EXAMPLES also. This patch makes the same
change for util-linux.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:54 +02:00
Michael Kerrisk (man-pages) 67e63c1263 Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.

One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:50 +02:00
Michael Kerrisk (man-pages) ade04bb89c Manual pages: order AUTHORS / COPYRIGHT / SEE ALSO / AVAILABILITY consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.

In this patch, we ensure that the AUTHORS, COPYRIGHT, SEE ALSO, and
AVAILABILITY sections are always placed at the end of the page.

Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:

    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
    [Apply patch]
    $ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
    $ diff a b
    $ echo $?
    0

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-22 10:25:49 +02:00
Michael Kerrisk (man-pages) a87f49f662 Manual pages: use the term "exit status"
The manual pages currently use a multitude of terms--"exit code",
"error code", "return code", "exit code", and so on--when what
is always meant is "exit status" (the POSIX term). This patch fixes
as many of these erroneous terms as I could find.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:52 +02:00
Michael Kerrisk (man-pages) 7e765c93dc Manual pages: Standardize on EXIT STATUS as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXIT STATUS (18), EXIT CODES (3), RETURN CODE (7),
RETURN CODES (1), or RETURN VALUE (4 instances in pages that document
commands, rather than functions).

Let's standardize on the EXIT STATUS (which is also what is
suggested in man-pages(7), and is the POSIX terminology).

A subsequent patch will clean up corresponding miswordings in
manual page text.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) ef293e185e Manual pages: Standardize on CONFORMING TO as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have STANDARDS (3) or CONFORMING TO (6).
Let's standardize on the latter (which is also what is
suggested in man-pages(7)).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Michael Kerrisk (man-pages) bc281b0991 Manual pages: Standardize on EXAMPLE as section title
There is quite some value (in terms of readability and user
expectations) if consistent names are used for the sections
within manual pages. This patch is one of a series to bring
about this consistency.

Currently we have EXAMPLE (10) or EXAMPLES (23).
Let's standardize on the EXAMPLE (which is also what is
suggested in man-pages(7)) and used consistently across
a large number of pages in the Linux man-pages project.

(I realize the choice to go EXAMPLE, rather than EXAMPLES,
may be debatable. If necessary, I'd write a patch that instead
goes the other way, but I'd prefer to follow man-pages(7).)

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-20 12:56:12 +02:00
Bjarni Ingi Gislason eb02489380 man pages: Add a comma after "e.g." and "i.e."
Add a comma (,) after "e.g." and "i.e.", or use English words
(man-pages(7) [package "manpages"]).

  Abbreviation points should be protected (usually with the
non-printing, zero width character '\&') from being interpreted as an
end of sentence, if they are not, and that independent of their current
place on the line.

  This is important when typing, as one does not usually know in
advance when the editor jumps to a new line.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2019-12-17 12:32:43 +01:00
Karel Zak 8fd512e932 logger: (man) add info about rewrite and authors
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-01-29 15:59:41 +01:00
Karel Zak bd0029f6be logger: (man) make more obvious that --server/socket is required
The options --tcp/udp specify only how, but no where.

Signed-off-by: Karel Zak <kzak@redhat.com>
2019-01-29 15:44:13 +01:00
Karel Zak 1c4a2600cc logger: concatenate multiple lines of MESSAGE into a single field.
this is deemed a useful special case since journalctl will only show
either the first or last element of the message array if the field
appears multiple times.

Based on patch from: Kjetil Torgrim Homme <kjetil.homme@redpill-linpro.com>
https://github.com/karelzak/util-linux/pull/743

Addresses: https://github.com/karelzak/util-linux/issues/742
Signed-off-by: Karel Zak <kzak@redhat.com>
2019-01-23 11:41:43 +01:00
Karel Zak 1f6583930b logger: add -S to the man page
Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-10 16:55:14 +02:00
Bjarni Ingi Gislason 62aa3f0eaf man pages: fix formatting of long lines in tables
Define the allowed length of the last (second) column to use the
whole line for text.

  Use text blocks for long lines.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 934a6fa80b man pages: Remove "left" (or change to "l") in the column formats of tables
A developmental version of "groff" issued a warning, for example with
"test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z":

troff: <logger.1>:299: warning: can't find font 't'

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 0bb7e904d7 man: Use the correct macro for a font change of one argument
Use the correct macro (I, B) for the font change of one argument, not
those that are used for alternating two fonts, like "BR", "IR", "RB",
or "RI".

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-05-23 10:43:27 +02:00
Sébastien Helleu d673b74e9d docs: replace FTP by HTTPS in kernel.org URLs
The links to ftp://ftp.kernel.org/ are replaced by
https://www.kernel.org/.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-19 11:22:26 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Sebastian Rasmussen d35df4db5b docs: Fix various typos
Signed-off-by: Sebastian Rasmussen <sebras@gmail.com>
2016-05-31 23:40:21 +02:00
Mike Frysinger 5593132a90 man pages: fix spacing between man page name & section number
Most have standardized correctly, but fix a few latent ones.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2016-05-20 10:54:31 +02:00
Karel Zak 28b6c76f8a logger: add man page note about the default --tag
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-05-16 15:05:28 +02:00
Karel Zak 9904521903 logger: keep man page consistent and use \- everywhere
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-03-10 14:36:22 +01:00
Benno Schulenberg da6bb5f8c3 logger: sort the options in the manpage alphabetically
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg 05e68ce728 logger: improve grammar and formatting of the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Karel Zak 27a9eb5359 logger: use --id as local socket credentials
If you have really paranoid syslog (or systemd who listens on /dev/log)
then it replaces in the message PID with a real PID from socket header
credentials:

 # echo $PPID
 1550

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:22:13 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:22:13 ws kzak[22100]: This is message baby!
                         ^^^^^

This patch forces kernel to accept another *valid* PID if logger(1)
executed with root permissions; improved version:

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:26:00 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:26:00 ws kzak[1550]: This is message baby!

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-29 11:18:21 +01:00
Karel Zak 4299ed1ce2 logger: add --sd-id and -sd-param
This patch add support for RFC 5424 structured data elements. For
example:

     logger --rfc5424 --sd-id zoo@123                \
                      --sd-param tiger=\"hungry\"    \
                      --sd-param zebra=\"running\"   \
                      --sd-id manager@123            \
                      --sd-param onMeeting=\"yes\"   \
                      "this is message"

produces:

     <13>1 2015-10-01T14:07:59.168662+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="218616"][zoo@123 tiger="hungry" zebra="running"][manager@123 onMeeting="yes"] this is message

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-01 14:48:15 +02:00
Michal Schmidt b632f55c29 logger: improve logger --journald man page example
The example use of logger --journald in the man page has a couple of flaws:
 - It's missing a "MESSAGE=" field. This is supposed to be the primary
   human readable text. Without it the log entry is invisible in a
   plain "journalctl" output.
 - The MESSAGE_ID is supposed to be a 128-bit hexadecimal string that
   globally uniquely identifies the message type.
   One can generate such an id with "journalctl --new-id".

This patches fixes the above and also changes the example to use a
here-document instead of printf. In my opinion it makes the expected
multi-line data format more obvious.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
2015-09-07 08:54:15 +02:00
Alex Bligh b6b67955ef logger: Add support to logger for RFC6587 octet counting
This patch adds support to logger for RFC6587 octet counting.
RFC6587 provides support for two sorts of framing:

1. Octet counting (at RFC6587 s3.4.1)

   In essence each frame is preceded by a decimal length and a
   space.

2. Non-transparent framing (at RFC6587 s3.4.2), also called
   'octet stuffing'

   In essence each frame is terminated by a `\n`

Prior to this patch, logger used option 2 (non-transparent framing)
on TCP, and used no framing on UDP. After this patch, the default
behaviour is unchanged, but if the '--octet-count' option is supplied,
option 1 is used for both TCP and UDP. Arguably octet count framing
makes little sense on UDP, but some servers provide it and this
allows testing of those servers.

Signed-off-by: Alex Bligh <alex@alex.org.uk>
2015-07-29 10:33:25 +02:00
Karel Zak 3c1a1bad73 logger: add note about kern->user conversion
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-24 12:17:32 +02:00
Karel Zak fd343a0572 logger: add --no-act for testing
* force --journal mode to also output to stderr when the option
  --stderr specified on command line

* add --no-act to avoid all write() operations to make it possible to
  write tests without "spam" system logs

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-16 12:38:46 +01:00
Rainer Gerhards 7c7c77a116 logger man page: fix typo 2015-03-10 17:48:05 +01:00
Rainer Gerhards 55f5bc662e logger: add --msgid option, permits to set RFC5424 MSGID field 2015-03-10 17:47:30 +01:00
Rainer Gerhards ae6846b842 logger: add --skip-empty-lines to prevent logging empty lines
Empty log messages are generally considered useless. This option
enables to turn them off when processing files (including stdin).

[kzak@redhat.com: - rename --skip-empty-lines to --skip-empty,
                  - add the option to getopt_long(),
                  - add the option to bash-completion]

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 11:19:33 +01:00
Rainer Gerhards a43022fdd4 logger man page: update --size doc
now we have strict sizes

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 11:19:33 +01:00
Rainer Gerhards f68b8aa7f5 logger: permit to send messages larger than 1024 characters
This is an important capability that has been specified in RFC5424.
However, messages larger than 1024 chars are being accepted for years
now by at least rsyslog and syslog-ng.

This patch adds the option --size to permit setting a new max
size, with 1024 being the default.

Note that the size limit is only approximative, as we do not take the
header size in account (RFC talks about total message length).

[[kzak@redhat.com: - add 'S' to getopt_long(),
                   - rename --message-size to --size
                   - add the option to bash-completion]

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-10 11:19:16 +01:00
Rainer Gerhards 2346420a01 logger man page: bump man page date to current 2015-03-06 12:32:12 +01:00
Rainer Gerhards a435617319 logger man page: fix some "syslog(3) routine" remnants 2015-03-06 12:31:51 +01:00
Karel Zak 1c936504d5 logger: remove "interface to syslog(3)" from man page
since v2.26 logger does not use syslog(3) anymore

Reported-by: Rainer Gerhards <rgerhards@adiscon.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-03-06 11:48:23 +01:00
Sami Kerola 3f51c10b39 logger: fix -i argument parsing regression
With earlier logger it's possible to combine the option -i with other
options, such as -s.  But currently:

$:~> logger -is
logger: failed to parse id: 's'

The changed behaviour breaks existing scripts like dhcpcd-run-hooks from
dhcpcd.

Broken-since: aab5b44405
Reference: http://comments.gmane.org/gmane.linux.utilities.util-linux-ng/9683
Reported-by: Juergen Daubert <jue@jue.li>
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-03-05 10:31:18 +01:00
Sami Kerola d77dc29e6e logger: add --socket-errors compatibility option
Hello,

Depending viewpoint this change is either regression fix, or
re-regression in context of none-systemd init.  I ack the change is sent
very late to be part of v2.26, but then again the excess noise was found
only because of -rc1 was tested in sysvinit environment.  IMHO it would
contradict purpose of having rc's if faults will not lead to fixes.

I also want to point out the sysvinit scripts are broken, not the
logger(1), but getting them corrected is practically impossible.
Assuming sysvinit script are further developed by various teams and
distributions who maintain them they should use --socket-error=on in
future, and write scripts that pass without noise.  Meanwhile trying to
be clever when to silence errors seems like a reasonable thing to do.

--->8----
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 14 Feb 2015 19:05:55 +0000
Subject: [PATCH] logger: add --socket-errors compatibility option

Now when logger(1) has stopped using openlog() for Unix sockets, in
commit mentioned in reference, the lack of /dev/log detected will report
error accordingly.  According to Gabriele Balducci this makes sysvinit
style boot scripts to print a lot of errors.  So make the logger to
detect whether it should be in compatibility mode, and not report errors
if logging device is missing.  That imitates behavior of glibc openlog().

To allow full control to users the /dev/log error messages can be forced
to on or off.  The automatic error messaging is explained in manual page.

Reference: 1d57503378
Reported-by: Gabriele Balducci <balducci@units.it>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-16 11:08:24 +01:00
Karel Zak 3d0b57d62c Merge branch 'opts' of https://github.com/jwpi/util-linux 2015-01-26 11:31:05 +01:00
Benno Schulenberg 981997dd37 docs: fix two spellings in man page of logger
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-26 11:22:13 +01:00
J William Piggott b06c1ca6f8 docs: restore minus symbols in long opts
Signed-off-by: J William Piggott <elseifthen@gmx.com>
2015-01-20 18:15:30 -05:00
Benno Schulenberg 3a60b1c26b docs: remove obsolete and unneeded comments from man-page files
Transform some of them into copyright lines.
Also fix three header lines and snip some trailing whitespace.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-01-12 11:03:26 +01:00
Benno Schulenberg a54b8e245f docs: adjust the grammar, text, sorting and formatting of logger man page
The message argument is not an option and should not be listed among
those.  Describe the optional argument of --rfc5424 better.  Use the
= and no space for optional option arguments.  Don't italicize words
unnecessarily.  Use bold for literal things.  And sort the options
alphabetically (apart from -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:24 +01:00
Benno Schulenberg f49ccec212 docs: don't use bold or italics for "[option]" in synopsis of man pages
As per the convention shown in Documentation/howto-man-page.txt.
Also make a few other tiny adjustments along the way.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-12-19 09:57:23 +01:00
Ville Skyttä 9779f59831 docs: Spelling fixes
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-11-18 13:59:19 +01:00
Karel Zak 59c6ac0b92 logger: use generic --id=<id>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-08-20 12:24:40 +02:00
Sami Kerola b09697c3e0 docs: mentintion default udp and tcp ports logger is using
The fact that 'syslog tcp/514' does not exist in RFS's, which has lead
to 'syslog-conn 601/tcp' be used in place could be a suprice and should
be told in manual.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-08-15 21:52:12 +01:00