Port commit
commit 6cb8af7be2
Author: Jiaxun Yang <jiaxun.yang@flygoat.com>
Date: Sat Mar 28 12:19:42 2020 +0800
to new lscpu code.
References: 6cb8af7be2
Signed-off-by: Karel Zak <kzak@redhat.com>
Port commit
commit 318542e060
Author: Sumanth Korikkar <sumanthk@linux.ibm.com>
Date: Fri Jun 5 18:15:10 2020 +0200
to new lscpu code.
References: 318542e060
Signed-off-by: Karel Zak <kzak@redhat.com>
ntypes greater than 1 is valid in some hardware configurations, and an assert()
on the value isn't necessary or very future proof
[kzak@redhat.com: - port this patch to new code]
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep global (cputype) bogomips
* add per-CPU bogomips
* use bogomips from the first CPU as global (for cputype) if /proc/cpuinfo does not provide global bogomips
* add BOGOMIPS column for to -e/-p output
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's make it more robust and readable. The sysinfo file on s390 may
contain zeros, so we need to check the values and fallback to data
from shared maps if necessary.
Signed-off-by: Karel Zak <kzak@redhat.com>
Note that cxt->ncaches is number of all instances, but we split
output according to split output according to caches names.
Signed-off-by: Karel Zak <kzak@redhat.com>
The file /sys/devices/system/cpu/cpu*/cache/index*/id is not available
in old kernels. This patch add code to generate IDs according to cache
type and level.
Signed-off-by: Karel Zak <kzak@redhat.com>
* keep one sharedmap per cache instance
* initialize topology IDs to -1
* rewrite -e code to use a new data structs
Signed-off-by: Karel Zak <kzak@redhat.com>
The Dynamic and Static MHz are /proc/cpuinfo s390 per-CPU fields, but
we display it as a single value according the first parsed CPU. For
this purpose we store the values from the first CPU in lscpu_cputype.
For -p and -e outputs we will print per CPU values.
Signed-off-by: Karel Zak <kzak@redhat.com>
The cache is identified by Type, Level and ID, the ID is unique cache
instance identifier (of the type).
This changes forces lscpu allocate more lscpu_cache instances (than
old version), but now we're ready for arbitrary scenario where
different CPU types share caches and the same cache type uses
different size in different instances, etc.
Signed-off-by: Karel Zak <kzak@redhat.com>
This is the first step in conversion from old lscpu to the new code.
The patch removes obsolete code from lscpu.c and lscpu.h. The old
output code in lscpu.c is temporary disabled by #ifdef due to
incompatibility between old and new internal APIs -- this will be
changed later by small steps to make all all the changes review-able.
Signed-off-by: Karel Zak <kzak@redhat.com>
Don't use global CPU masks (like "online" or "present") to
calculate type specific number of threads due systems with
mixed CPU types.
It's also necessary to check all thread_siblings maps to get the
highest number, because some threads (CPUs) may be disables, for
example old lscpu calculates number of threads from the cpu0 and
if you disable cpu0's sibling (cpu4):
CPU(s): 8
On-line CPU(s) list: 0-7
Thread(s) per core: 2 <---
Core(s) per socket: 4
Socket(s): 1
# chcpu --disable 4
CPU 4 disabled
CPU(s): 8
On-line CPU(s) list: 0-3,5-7
Off-line CPU(s) list: 4
Thread(s) per core: 1 <--- !
Core(s) per socket: 4
Socket(s): 1
because 'thread_siblings' contains only one thread for cpu0:
# cat /sys/devices/system/cpu/cpu{0,1,2,3,4,5,6,7}/topology/thread_siblings_list
0
1,5
2,6
3,7
cat: /sys/devices/system/cpu/cpu4/topology/thread_siblings_list: No such file or directory
1,5
2,6
3,7
Signed-off-by: Karel Zak <kzak@redhat.com>
* move structs definitions to header file
* define set of /proc/cpuinfo parsing patterns for cpu-type and for
CPUs
Signed-off-by: Karel Zak <kzak@redhat.com>
The current lscpu assumes that all CPUs in the system are the same.
Unfortunately this is not true. We need to split all internal CPUs
descriptions to CPU-type and CPU.
This patch add lscpu-cputype.c where will be CPU-type description --
mostly based on /proc/cpuinfo.
Signed-off-by: Karel Zak <kzak@redhat.com>
When calling variadic functions, NULL must be explicitly cast to a
desired type.
This is noted in the exec(3) manpage.
The call in newgrp.c was changed for consistency.
Signed-off-by: Egor Chelak <egor.chelak@gmail.com>
Up on successful fdopendir(3) file descriptior that will be closed, that
happens in recursiveRemove() switch_root(8) function.
CID: 360697
Reference: https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdopendir.html
Co-Author: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
If a call to chroot is not followed by a call to chdir("/") the chroot jail
confinement can be violated. See also CWE-243.
CID: 360718
CID: 360800
Reference: http://cwe.mitre.org/data/definitions/243.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Variable cap was 32 bits and shifting it by 64 bits resulted to the shift
going over a variable boundary.
CID: 360799
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
In 9995da0 we added support to fstrim to be able to fall back to
`/proc/self/mountinfo` if `/etc/fstab` didn't exist, but we forgot
to remove the `/etc/fstab` condition from the timer. Let's remove
that condition from the timer so we can go back to periodically
running `fstrim.service`.
issue report:
if i run the heavy duty test from #16859 a couple of times I can get
the loopback layer in the kernel into a state where there's a loopback
block device allocated, that you can open, but where both LOOP_CLR_FD
and _SET_FD fail with EBUSY. and /dev/loop-control still returns it as
the next free one... weird state util-linux losetup when called to
allocate a new device then freezes
This commit:
* restrict number of attempts to 16
* use 200000ms sleep between attempts
* add note about non-atomic loop device setup to the man page
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
The library is not distributed and almost all code in this ar(1)
archive is Public Domain or LGPL ... but let's avoid any doubts and do
not mix non-GPL and GPL code there.
Addresses: https://github.com/karelzak/util-linux/issues/1157
Signed-off-by: Karel Zak <kzak@redhat.com>
ARM SBBR (Sever Base Boot Requirements) require SMBIOS tables, and
SMBIOS Type 4 describes the CPU manufacturer and model name (among other
details). If SMBIOS Type 4 is present, use it to extract these strings.
Example output (before and after the patch) on an HP m400, Lenovo HR330A,
and HPE Apollo 70:
[root@hp-m400 ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: APM
Model: 1
Model name: X-Gene
Stepping: 0x0
[root@hp-m400 ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: AppliedMicro
Model: 1
Model name: X-Gene
Stepping: 0x0
[root@lenovo-hr330a ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: APM
Model: 2
Model name: X-Gene
Stepping: 0x3
[root@lenovo-hr330a ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: Ampere(TM)
Model: 2
Model name: eMAG
Stepping: 0x3
[root@hpe-apollo-70 ~]# /usr/bin/lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: Cavium
Model: 1
Model name: ThunderX2 99xx
Stepping: 0x1
[root@hpe-apollo-70 ~]# ./lscpu | grep -i -e vendor -e model -e stepping
Vendor ID: Cavium Inc.
Model: 1
Model name: Cavium ThunderX2(R) CPU CN9980 v2.1 @ 2.20GHz
Stepping: 0x1
[kzak@redhat.com: - move dmi_header to lscpu.h
- make arm_cpu_smbios() more robust for failed
open() and read()
- use original arm_cpu_decode() also on failed
arm_cpu_smbios()]
Signed-off-by: Jeffrey Bastian <jbastian@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
I discovered that making a file sparse with "fallocate -d filename"
fails on the last block of a file, because - usually being partial -
the system call only zeroes that part instead of deallocating the
block. See man fallocate(2) - section "Deallocating file space".
The expected call is punching the whole block beyond eof, which
doesn't change the file length because of flag FALLOC_FL_KEEP_SIZE.
Signed-off-by: Karel Zak <kzak@redhat.com>
Add a command that answers the the question:
"How much data can I store on this device/in this range of zones?"
Implement this by summing up zone capacities over the given range.
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
This adds support for the "nosymfollow" mount option, which indicates
that symlinks should not be traversed on the mount this option is
applied to. Also update the mount(8) man page with information about
this option.
Signed-off-by: Mattias Nissler <mnissler@chromium.org>
Signed-off-by: Ross Zwisler <zwisler@google.com>
turns out this is subtly broken. musl 1.2.x for 64-bit architectures defines __NR_settimeofday but not
for 32-bit ones. For 32-bit, it defines a _time32 variant.
The commands mount and umount sanitize environment variables as it
works with suid permissions by default. Since v2.36 it's possible
that the commands drop the permissions and continue as regular user.
It seems we also need to restore the original environ to keep things
consistent for users (e.g. HOME=).
The implementation is pretty simple -- it keeps in memory removed
variables and use it after switch to non-suid mode.
Addresses: https://github.com/karelzak/util-linux/issues/880
Signed-off-by: Karel Zak <kzak@redhat.com>
Suggested by Karel, add additional description to make softirq more
friendly to end-user. Discuss about this:
https://github.com/karelzak/util-linux/pull/1079
Note that, we should keep softirqs table align to kernel source code.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
Add '-S' or '--softirq' for irqtop/lsirq, instead of interrupts, show
softirqs infomation. Because there is no more description of softirq,
do not show 'NAME' column by default.
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
NVMe ZNS specification defines zone capacity. The report zone interface
of Linux kernel supports it. Expose it in report zone by blkzone command.
Signed-off-by: Hans Holmberg <hans.holmberg@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
The wording "allow(s) to" is not grammatical English. Reword various
pages to use a more correct form such "can be use to" or "allows
the [noun] of".
Aklong the way, fix a few nearby wording errors in some pages.
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Remove a second paragraph macro (.TP, .PP) as it does not change the
output (.SS/.PP) or it adds an extra empty line (.TP/.TP)
Warning from "mandoc -Tlint":
mandoc: ./sys-utils/hwclock.8.in:299:2: WARNING: line scope broken: TP breaks TP
mandoc: ./sys-utils/hwclock.8.in:459:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:543:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:574:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:673:2: WARNING: skipping paragraph macro: PP after SS
mandoc: ./sys-utils/hwclock.8.in:721:2: WARNING: skipping paragraph macro: PP after SS
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Enabling libcrypsetup in libmount had several unintended side
effects.
First of all, it increases the Debian minimal image size by
~2.5% (5.6MB worth of new libraries).
Then, due to libcryptsetup linkage to OpenSSL and libjson-c,
it causes incompatibilities with external programs linking
against both libmount and a private, static, old version of
OpenSSL, or external programs linking against libjansson or
json-glib, which have one symbol in common with libjson-c.
If ./configure is ran with --with-crypsetup=dlopen,
instead of linking to libcrypsetup, use dlopen to resolve
the symbols at runtime only when the verity feature is
used, thus avoiding clashes and keeping images size down.
Fixes#1081
Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
Split two long lines, adding '\e' at the end of the first part,
as otherwise the last part of them disappears at the right margin in
the printed output (pdf).
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Since aarch64 kernel can be configured with compat 32-bit support
enabled, extend translation rules in a way similar to x86/x86_64.
Suggested-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
When other compatible architectures are introduced, they will also have
to be added to the verifier.
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
"--direct-io" option is "off" by default while configuring
loop device but it's mentioned "on" in man page.
Signed-off-by: Rupesh Girase <rgirase@redhat.com>
Currently the blkdiscard has the ability to wipe out entere device in a
matter of seconds. This is fine as long as it's intentional, it is
potentially catastrophic if it's not.
With this commit blkdiscard will check for existing signatures on the
device and refuse to continue if any are found unless the operation is
forced with the -f option.
In an attempt to avoid breaking existing automation scripts the force is
only required when stdin refers to a terminal.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
The kernel imposes various restrictions on the changes that can be
made to the inheritable, ambient, and bounding sets. Warn the user
about that.
Signed-off-by: Michael Kerrisk (man-pages) <mtk.manpages@gmail.com>
Source is current git content.
Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
[ "test-groff" is a developmental version of "groff" ]
Input file is ././disk-utils/sfdisk.8
troff: backtrace: file '<./disk-utils/sfdisk.8>':67
troff: <./disk-utils/sfdisk.8>:67: warning: trailing space
Input file is ././misc-utils/kill.1
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':133: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: macro 'mF' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'mE' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: bad font number
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':135: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':167
troff: <./misc-utils/kill.1>:167: warning: number register 'sP' not defined
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-ext.tmac':134: macro 'EE'
troff: backtrace: file '<./misc-utils/kill.1>':170
troff: <./misc-utils/kill.1>:170: warning: bad font number
Input file is ././sys-utils/ipcs.1
<./sys-utils/ipcs.1>:103 (macro BR): only 1 argument, but more are expected
Input file is ././sys-utils/mount.8
<./sys-utils/mount.8>:68 (macro RB): only 1 argument, but more are expected
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':467: macro 'RB'
troff: backtrace: file '<./sys-utils/mount.8>':68
troff: <./sys-utils/mount.8>:68: warning [p 1, 3.5i]: can't break line
an-old.tmac: <./sys-utils/mount.8>:201 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.
<./sys-utils/mount.8>:453 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:500 (macro BR): only 1 argument, but more are expected
<./sys-utils/mount.8>:1050 (macro BR): only 1 argument, but more are expected
Input file is ././sys-utils/setpriv.1
<./sys-utils/setpriv.1>:17 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:154 (macro BR): only 1 argument, but more are expected
<./sys-utils/setpriv.1>:166 (macro BR): only 1 argument, but more are expected
Input file is ././sys-utils/umount.8
<./sys-utils/umount.8>:145 (macro IR): only 1 argument, but more are expected
Input file is ././sys-utils/unshare.1
<./sys-utils/unshare.1>:266 (macro BR): only 1 argument, but more are expected
[kzak@redhat.com: - add .RS to fix extra .RE in mount.8]
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Signed-off-by: Karel Zak <kzak@redhat.com>
Document
- `-t` when listing mounts
- `--bind`, `--rbind`, and `--move`
- `--make-*`
- Mountpoints need not only be directories
[kzak@redhat.com: - cleanup syntax,
- use all complete --make-* list]
Signed-off-by: Karel Zak <kzak@redhat.com>
The shared cache info for s390 can be found in /proc/cpuinfo.
lscpu without any options already processes this info. Fix this
in lscpu -C and provide detailed stat.
Test for s390:
./lscpu -C
NAME ONE-SIZE ALL-SIZE WAYS TYPE LEVEL SETS PHY-LINE COHERENCY-SIZE
L1d 128K 256K 8 Data 1 64 256
L1i 128K 256K 8 Instruction 1 64 256
L2d 4M 8M 8 Data 2 2048 256
L2i 2M 4M 8 Instruction 2 1024 256
L3 128M 32 Unified 3 16384 256
L4 672M 42 Unified 4 65536 256
Signed-off-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
C compiler is smart enough to follow C standards
C11: 6.7.8 Initialization
All subobjects that are not initialized explicitly shall be
initialized implicitly the same as objects that have static storage
duration.
Signed-off-by: Karel Zak <kzak@redhat.com>
Commit 7a2602f629 ("blkzone: deny destructive ioctls on busy blockdev")
introduced exclusive mode to open block devices to submit zone management
ioctls. This avoids unintended status change of block devices used by the
system. However, it makes blkzone less usable for testing. For example,
the test case zbd/007 of blktests utilizes blkzone to reset zones of
block devices mapped to dm-linear devices. After the commit, the test
case fails with EBUSY error at blkzone reset, since the system uses the
reset target block device to map to the dm-linear device.
To allow blkzone to change status of zoned block devices used by the
system with intention, introduce --force option. With this option, block
devices are opened without exclusive mode.
Also fix too many periods in man page of --verbose option.
[kzak@redhat.com: - tiny cosmetic changes]
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Timestamps in kernel log comes from monotonic clocksource which does not
tick when system suspended. Suspended time easily sums into hours and days
rendering human readable timestamps in dmesg useless.
Adjusting timestamps accouring to current delta between boottime and
monotonic clocksources produces accurate timestamps for messages printed
since last resume. Which are supposed to be most interesting.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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 ENVIRONMENT, FILES, and CONFORMING TO
sections are always placed toward the end of the page, just above NOTES.
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>
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>
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>
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>
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>
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 OPTIONS (many) or OPTION (1 page, setpriv(1),
which actually supports multiple options!).
Let's standardize on OPTIONS (which is also what is
suggested in man-pages(7)).
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
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>
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.
In the Linux man-pages project, I long ago did away with the
AUTHOR(S) section, but I realize some projects like to keep this.
But, let's make sure that the section is consistently titled
across pages. Currently we have AUTHOR (47) or AUTHORS (41).
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>
Using double quotes in .SH lines containing multiple words is unneeded,
and in any case is not consistently done in the util-linux manual pages,
where double quotes are used in only around half of the cases.
(This usage was long ago elminated in the man-pages project, with
no ill effects reported to date.)
Remove these quotes, so that .SH lines are more uniform, in preparation
for some (more easily) scripted doiscovery of consistency problems in
(and possibly global fixes to) the manual pages.
Other than stripping the double quotes, this patch makes no changes to
the content of the manual pages.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Most date back to reorganisation of the Documentation/ tree in 2016,
new paths based on v5.7-rc5:
fdisk.8: Documentation/{,admin-guide/}devices.txt
eject.c: Documentation/{,userspace-api/}ioctl/cdrom.rst
mount.8: Documentation/filesystems/adfs.{txt,rst}
rfkill.8: Documentation/{rfkill.txt,driver-api/rfkill.rst}
tunelp.8: Documentation/{parport.txt,admin-guide/parport.rst}
zramctl.8: Documentation/{blockdev/zram.txt,admin-guide/blockdev/zram.rst}
Signed-off-by: Yannick Le Pennec <yannick.lepennec@live.fr>
With changes starting around util-linux commit 058e81540f
that switched from using IPC_STAT to parsing /proc/sysvipc/*,
ipcs now shows all IPC objects rather than just the objects for
which the user has read permission. Update the page to reflect this
fact, and also add a NOTES section describing the historical and
fallback behavior where /proc is not available.
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
[ "test-groff" is a developmental version of "groff" ]
Input file is ././misc-utils/kill.1
<./misc-utils/kill.1>:173 (macro BR): only 1 argument, but more are expected
Input file is ././misc-utils/lsblk.8
troff: backtrace: '/home/bg/git/groff/build/s-tmac/an-old.tmac':478: macro 'BR'
troff: backtrace: file '<./misc-utils/lsblk.8>':122
troff: <./misc-utils/lsblk.8>:122: warning: trailing space
Input file is ././sys-utils/mount.8
an-old.tmac: <./sys-utils/mount.8>:2427 (.RE): warning: extra .RE or .RS is missing before it; "an-RS-open" is 0.
Input file is ././sys-utils/unshare.1
<./sys-utils/unshare.1>:176 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:181 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:240 (macro BR): only 1 argument, but more are expected
<./sys-utils/unshare.1>:246 (macro BR): only 1 argument, but more are expected
Input file is ././term-utils/agetty.8
troff: backtrace: file '<./term-utils/agetty.8>':130
troff: <./term-utils/agetty.8>:130: warning: trailing space
Input file is ././text-utils/more.1
troff: backtrace: file '<./text-utils/more.1>':91
troff: <./text-utils/more.1>:91: warning: macro 'b' not defined
The output from nroff and troff is unchanged, except for the word
"number" in text-utils/more.1, that was missing.
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>