Commit Graph

14318 Commits

Author SHA1 Message Date
Michael Kerrisk (man-pages) 4d4f56baad Manual pages: unshare.1: clarify that --pid=<file> requires --fork
Attempting to create a persistent PID namespace with --pid=<file>
will result in an error if --fork is not also specified. Let's
warn people about that, so they don't get puzzled.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-03 17:05:37 +02:00
Michael Kerrisk (man-pages) 48994386a1 Manual pages: unshare.1: clarify description and example for --mount=<path>
The existing text is not quite accurate, and I recently injected an
error into the EXAMPLES. This patch fixes both issues.

The text in DESCRIPTION incorrectly states that the propagation type of
the parent mount must be "private". This is not accurate.  Rather, the
propagation type must be something *other than "shared"* (i.e.,
"private", "slave", or "unbindable").

In the EXAMPLES section, I added text that implies that if the
propagation type of the parent mount is "shared", then the child mount
created by --mount=<path> might propagate to another namespace.
Rather, in this situation, an error would result. Clarify that.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-06-03 17:03:56 +02:00
Karel Zak b3391f3ac7 libmount: add support for ID=
This patch add support for a new tag. The tag is based on udev block
device ID (see /dev/disk/by-id). The usual use-case is to use
WWN for this purpose, for example

  # mount ID=wwn-0x50026b724b09a1ff /mnt

Note that ID is not strictly defined and udevd generates various IDs
also for HW where WWN is undefined. This is reason why introduce ID=
seems better and more generic than more restrictive WWN=.

Addresses: https://github.com/karelzak/util-linux/issues/1008
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-03 16:53:00 +02:00
Karel Zak 72bc0dd27c mount: (man) cleanup devices identifiers section
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-01 14:53:47 +02:00
Karel Zak a437692943 login: cleanup -f in usage() and comments
Let's remove unnecessary comment and "second authentication" from
usage().

Addresses: https://github.com/karelzak/util-linux/issues/1053
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-06-01 10:33:29 +02:00
Konstantin Khlebnikov d7881b0ed5 dmesg: add --follow-new
Option --follow-new (-W) works the same as --follow (-w) but initially
seeks to the end of kernel ring buffer, so it prints only new messages.
Useful for capturing kernel messages during actions without past log.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
2020-06-01 09:55:49 +02:00
Karel Zak f0833edc12 login: fix -f description in the man-page
Addresses: https://github.com/karelzak/util-linux/issues/1053
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-29 14:50:36 +02:00
Michael Kerrisk (man-pages) 96e47ad0cb Manual pages: mount.8: Miscellaneous wording, grammar, and formatting fixes
Most of these are "obviously correct":
- formatting fixes
- improved English wordings
- add missing articles ("a", "the")
- a few spelling fixes
- a few "obvious" corrections to the text

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 14:31:47 +02:00
Michael Kerrisk (man-pages) 1538f6f636 Manual pages: wording fix: "another" ==> "other"
In several pages, there is a consistent wording problem: "another"
where "other" should be used. This wording problem can be
surprisingly confusing for native speakers, especially those
unaware that in some other languages, "another" and "other" can be
expressed with the same word.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 14:31:47 +02:00
Karel Zak f8ad710f6c build-sys: add missing LDADD to blkid test
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-29 09:54:48 +02:00
Michael Kerrisk (man-pages) 79eab6383f Manual pages: umount.8: use "filesystem" consistently
Currently, this page has a mix of "filesystem" and file system",
with the former being predominant.  Let's settle on one.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) b3222042a1 Manual pages: mount.8: Rewrite FILESYSTEM-SPECIFIC MOUNT OPTIONS intro
Add a table listing other manual pages that describe mount options
of some widely used filesystems. Additionally, rewrite the remaining
text to be a bit easier to read.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) 4330d74d96 Manual pages: mount.8: Typo fix (remove an accidental paragraph break)
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) f95c9776c2 Manual pages: mount.8: SEE ALSO: add some obvious references
And correct sort order for "umount(8)" entry.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) cfd6b4dc1d Manual pages: mount.8, umount.8: Consistently format pathnames with italic
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) 2a425c02e4 Manual pages: mount.8, umount.8: Clarify that "namespace" means "mount namespace"
There are various references to "namespaces" when it would be
clearer to say "mount namespaces". Also, add references to the
mount_namespaces(7) manual page.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) 4281542466 Manual pages: setpriv.1: Minor formatting and typo fixes
These seem all "obviously correct", so I'm rolling them up
into one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) 583e50dbd0 Manual pages: unshare.1: typo fix
(Introduced in one of my earlier commits)

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Michael Kerrisk (man-pages) a8176639da Manual pages: unshare.1: EXAMPLES: improve persistent mount namespace example
The text describing the persistent mount namespace example
is rather confused. Explain more clearly the purpose of making
the parent directory a bind mount with private propagation.
Also make a few other wording improvements.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-29 09:44:58 +02:00
Helge Deller 2261cfdc26 setarch: fix stderr handling in uname26 tests
A while ago stdout and stderr have been split in these testcases, but
"FATAL: kernel too old" is actually treated as an "okay" output. However
this FATAL ends up on stderr, so when it happens, it is not seen in
the captured stdout.

Fix this by merging stdout/stderr in these cases once again.

Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Chris Hofstaedtler <zeha@debian.org>
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=961639
Fixes: cbf858aa08
2020-05-28 15:59:13 +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) 79a0cc9d02 Man pages: ipcmk.1, ipcs.1, lsipc.1: explicitly mention "System V"
Explicitly mention "System V" in the description, so that readers do not
get confused with the POSIX IPC mechanisms.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:53 +02:00
Michael Kerrisk (man-pages) fdd6a44f4c Manual pages: ipcmk.1, ipcrm.1, ipcs.1, lsipc.1: SEE ALSO: add sysvipc(7)
These commands all relate to System V IPC, so point the reader
at the relevant Section 7 page provided by the Linux man-pages
project.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:53 +02:00
Michael Kerrisk (man-pages) a374630f76 Manual pages: kill.1: improve the description of the --timout option
The text describing this option is a little hard to understand.
Improve it.

Cc: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:52 +02:00
Michael Kerrisk (man-pages) 226c38d447 Manual pages: kill.1: various language, spelling, and formatting fixes
These seem all "obviously correct", so I'm rolling them up into
one patch.

Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
2020-05-28 14:51:51 +02:00
Karel Zak e4253d3ca4 swapoff: do not use 1 exist status at all
The make sure we are not in collision with old versions.

Addresses: https://github.com/karelzak/util-linux/issues/1050
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-28 12:51:26 +02:00
Karel Zak ecfa4dad6f swapoff: cleanup EXIT STATUS
The current code hides details about reason why swapoff(8) and swapoff(2) failed. For example
ENOMEM from swapoff(2) is important as it indicates OOM.

The patch also clean ups --all return codes to be more compatible for
example with [u]mount --all, etc.

Addresses: https://github.com/karelzak/util-linux/issues/1050
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 18:58:30 +02:00
Karel Zak c7fce443b1 libfdisk: (dos) be more explicit in fdisk_verify_disklabel() output
Let's print number of detected errors or "No errors detected." for
MBR. We already use the same for GPT.

The patch also modifies fdisk_verify_disklabel() return code to inform
caller about number of issues.

Addresses: https://github.com/karelzak/util-linux/issues/1051
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 17:49:26 +02:00
Karel Zak 9cd88771ef fdisk: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 17:00:41 +02:00
Karel Zak 921ceaca31 wipefs: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 17:00:08 +02:00
Karel Zak c3ef1268a0 sfdisk: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 16:59:46 +02:00
Karel Zak b8671fe763 mkswap: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 16:59:16 +02:00
Karel Zak ec8f712157 cfdisk: add --lock and LOCK_BLOCK_DEVICE
Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-27 16:58:08 +02:00
Karel Zak 37b302046a lib/blkdev: add support for --lock and LOCK_BLOCK_DEVICE
All simple function to parse --lock <mode> and $LOCK_BLOCK_DEVICE,
and to flock the fd.

The supported <mode> is:

	"1" or "yes"	- LOCK_EX
	"0" or "no"	- do nothing
	"nonblock"	- LOCK_EX | LOCK_NB

The function tries LOCK_NB before the solo LOCK_EX and prints
inform user that it will wait, for example:

session A:
	# sfdisk --lock /dev/sdc

session B:
	# sfdisk --lock /dev/sdc
	sfdisk: /dev/sdc: device already locked, waiting to get lock ...
	^C

	# sfdisk --lock=nonblock /dev/sdc
	sfdisk: /dev/sdc: device already locked

Addresses: https://github.com/karelzak/util-linux/issues/921
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-26 17:30:39 +02:00
Karel Zak 498f910eeb build-sys: add $LDADD and libcommon to test_logindefs_LDADD
Addresses: https://travis-ci.org/github/karelzak/util-linux/jobs/690915120
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-26 11:43:07 +02:00
Sami Kerola 2eb527722a more: avoid libmagic telling an empty file is binary
My earlier change that took libmagic in use to identify mime-type of an input
file caused empty files to be marked binary.  Before the change empty files
were simply displayed as empty.  This change will restore that behavior.

Addresses: 09070e1a65
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2020-05-25 14:16:45 +02:00
Michael Kerrisk 3b98a78999 Manual pages: unshare.1: fix examples, part 3
The time namespaces example had no explanatory text!  Add some.
Also, use the "uptime -p" option for output that is more compact
(and perhaps more readable).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk d83194e34b Manual pages: unshare.1: fix examples, part 2
The explanation of the --kill-child example was quite confused and
also the example shell demo was broken because of quoting issues.

It is not the case that the *children* of 'program' would adopted by
init, but rather that 'program' itself (which would be running as PID
1 inside the namespace and is a child of 'unshare') would be adopted
by init.

Rework the --kill-child example. Add a lot more explanation, and
expand the example shell session to give the reader a much better
picture of what is going on.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk 34eede25c5 Manual pages: unshare.1: fix examples, part 1
The examples section of this manual page is rather hard to grok.
First, the arrangement of the text as follows makes life harder
than needed for the reader:

    shell demo
        explanatory text

It helps the reader if an example *begins* with an explanation of
what is being demonstrated. Therefore, rearrange these examples as:

    explanatory text
        shell demo

In addition, let's provide a bit more explanation for the first three
examples and expand the second example (user namespaces) a little.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk a4b3be3272 Manual pages: nsenter.1: note that 'file' can be a bind mount
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk afbe4f3455 Manual pages: nsenter.1: clarify the intro discussion
The intro paragraph talks about entering the namespace of other
processes. That's not quite accurate, since nsenter can be used (via
a bind mount) to enter a namespace that has no member processes.  So
rework NAME and the intro paragraph in DESCRIPTION to remove mention
of "processes".

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk 143087e1e4 Manual pages: unshare.1: improve intro paragraphs
The intro paragraphs of this page are rather hard for a newcomer to
grok. The name of the underlying system call (and consequently the
name of the command) are "strange", but let's help the reader by
naming more clearly what unshare(1) does: creating new namespaces. In
addition, clarify and expand the details on making a namespace
persistent using bind mounts.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk 6ff4b15647 Manual pages: nsenter.1, unshare.1: remove repeated references to clone(2)
Back in commits f85b9777c2 and 894efece9e, in the
description of each namespace type, I added repeated cross references
to clone(2). Drop these references. The Section 7 namespaces pages,
which are already noted in the nsenter(1) and unshare(1) manual pages,
provide much more relevant information. Furthermore, pointing the
reader at clone(2) is perhaps a little misleading, since the system
call underlying nsenter(1) is setns(2) and the system call underlying
unshare(1) is unshare(2).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk c89aadb727 Manual pages: nsenter.1, unshare.1: add a reference to time_namespaces(7)
Linux man-pages now has a page describing time namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Michael Kerrisk 6b2388d363 Manual pages: nsenter.1, unshare.1: update references to *_namespaces(7) pages
Nowadays, the Linux man-pages project provides separate Section 7
manual pages for each type of namespace. Update the cross references
in nsenter.1 and unshare.1 to reflect this.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-25 14:16:45 +02:00
Karel Zak fee9910661 build-sys: cleanup $vendordir use
- use --with-vendordir= (rather than --enable) to be compatible with
  another package stuuf

- add USE_VENDORDIR automake condition

- add vendordir to global AM_CPPFLAGS to avoid binary specific cflags
  modifications

Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-25 13:44:22 +02:00
Karel Zak d5e8818e03 Merge branch 'libeconf' of https://github.com/thkukuk/util-linux
* 'libeconf' of https://github.com/thkukuk/util-linux:
  Adjust test output to pass test suite
  Add support for libeconf
2020-05-25 12:23:13 +02:00
Karel Zak 9995da01e0 fstrim: add --listed-in <file[:file ..]>
This new option works like --all but it allows to specify multiple
files with filesystems to make fstrim configuration more portable
between distributions. For example:

 fstrim --listed-in /etc/fstab:/proc/self/mountinfo

forces fstrim to try fstab and if unsuccessful than try mountinfo.

Addresses: https://github.com/karelzak/util-linux/issues/1019
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-22 14:48:31 +02:00
Karel Zak 9a293ca078 bash-completion: chmod -x
Addresses: https://github.com/karelzak/util-linux/issues/1042
Signed-off-by: Karel Zak <kzak@redhat.com>
2020-05-22 12:02:25 +02:00
Karel Zak 9c6139a720 hwclock: improve use of settimeofday() portability
The different libc implements TZ deprecation in settimeofday() library
function in the different way. Let's hide these portability issues and
use directly Linux syscall to set timezone.

Addresses: https://github.com/karelzak/util-linux/issues/995
Signed-off-by: Karel Zak <kzak@redhat.com>
CC: J William Piggott <elseifthen@gmx.com>
2020-05-22 11:51:53 +02:00