The dmesg may require capabilities(7) when /proc/sys/kernel/dmesg_restrict
has none zero value. This is explained in detail in syslog(2) manual page.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Unfortunately, it's pretty common that users on production systems use
lazy umount to fix some FS issues. The usual result is unwanted system
reboot, because -l is not the right way how to fix unreachable NFS or
mess with local FS with submounts.
Note that after lazy umount /proc/self/mountinfo does not contain the
FS entry, but kernel still references the FS. It makes it very
difficult to debug.
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1566674
Suggested-by: Steve Dickson <steved@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Let's provide command line tool, man page with OOM description and
bash-completion. It seems better than force end-users to use "echo"
to /proc.
Addresses: https://github.com/karelzak/util-linux/issues/609
Signed-off-by: Karel Zak <kzak@redhat.com>
The POSIX standard states that poll(3P) is being made available by
<poll.h>, not <sys/poll.h>. Most commands already include the correct
header, with the exception of rfkill. Fix that to avoid a warning on
musl-based systems.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
When a process uses the syscall `prctl(PR_SET_PDEATHSIG, ...)`, it will
get notified with a process-defined signal as soon as its parent process
dies. This is for example being used by unshare(1)'s recently added
"--kill-child" option, causing the forked child to be killed as soon as
unshare itself dies.
Unfortunately, some LSMs will cause the parent death signal to be reset
when a process changes credentials, with the most important ones being
SELinux and AppArmor. The following command will thus not work as
expected:
unshare --fork --kill-child setpriv --reuid user <executable>
As soon as setpriv changes UID, the parent death signal is cleared and
the child will never get signalled when unshare gets killed.
Add a new option "--pdeathsig keep|clear|<signal>". Setting this flag
will cause us to either
- restore the previously active parent death signal as soon as the
setpriv has applied all credential changes
- clear the parent death signal
- set the parent death signal to "<signal>"
Furthermore, print out the currently set signal when dumping process
state.
[kzak@redhat.com: - small changes in codding style]
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Karel Zak <kzak@redhat.com>
Test nr. 2:
Enable and fix warnings from 'test-groff'.
Input file is /tmp/fallocate.1
<fallocate.1>:10 (macro IR): only 1 argument, but more are expected
<fallocate.1>:24 (macro RB): only 1 argument, but more are expected
<fallocate.1>:25 (macro IR): only 1 argument, but more are expected
chk_manuals: Output is from: test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z
and
Test nr. 15:
Change the name of a macro for two fonts (e.g., BR and IR) to one letter,
if there is only one argument.
Add the second argument if needed. It is sometimes part of the first one.
10:.IR length
24:.RB \-l
25:.IR length
#####
Test nr. 12:
Change -- in x--y to \(em (em-dash), or, if an
option, to \-\-
65:You can think of this option as doing a "\fBcp --sparse\fP" and then renaming
#####
Test nr. 20:
Use a macro to change to the italic font, instead of \fI [1], if
possible.
The macros have the italic corrections, but "\c" removes them.
[1] man-pages(7)
39:The \fIlength\fR and \fIoffset\fR
50:to be collapsed starts at \fIoffset\fP and continues
51:for \fIlength\fR bytes. At the completion of the operation, the contents of
52:the file starting at the location \fIoffset\fR+\fIlength\fR will be appended at the
53:location \fIoffset\fR, and the file will be \fIlength\fR bytes smaller. The option
71:Insert a hole of \fIlength\fR bytes from \fIoffset\fR, shifting existing data.
85:\fIoffset\fP and continuing for \fIlength\fR bytes. Within the
103:Zeroes space in the byte range starting at \fIoffset\fP and
104:continuing for \fIlength\fR bytes. Within the specified range, blocks are
#####
Test nr. 27:
Split lines longer than 80 characters into two or more lines.
Apropriate break points are the end of a sentence and a subordinate
clause.
fallocate.1: line 45 length 86
fallocate.1: line 52 length 83
fallocate.1: line 53 length 83
fallocate.1: line 100 length 95
#####
Test nr. 28:
Wrong distance between sentences or protect the indicator.
1) Separate the sentences and subordinate clauses; each begins on a new
line. See man-pages(7) and "info groff".
Or
2) Adjust space between sentences (two spaces),
3) or protect the indicator by adding "\&" after it.
The "indicator" is an "end-of-sentence character" (.!?).
99:Enable POSIX operation mode. In that mode allocation operation always completes,
#####
Test nr. 37:
Have a space after a comma in an argument to an alternating fonts macro.
The space belongs to the comma, so ', '.
48:.BR \-c , " \-\-collapse\-range"
58:.BR \-d , " \-\-dig\-holes"
70:.BR \-i , " \-\-insert\-range"
73:.BR \-l , " \-\-length " \fIlength
76:.BR \-n , " \-\-keep\-size"
80:.BR \-o , " \-\-offset " \fIoffset
83:.BR \-p , " \-\-punch\-hole"
95:.BR \-v , " \-\-verbose"
98:.BR \-x , " \-\-posix"
102:.BR \-z , " \-\-zero\-range"
119:.BR \-V , " \-\-version"
122:.BR \-h , " \-\-help"
#####
Test nr. 38:
Email addresses use the macro ".MT" and end with ".ME".
125:.UR sandeen@redhat.com
129:.UR kzak@redhat.com
#####
Test nr. 40:
Add a comma before "and", "or", or "nor" if a series contains three or
more words
41:MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is
43:KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB.
45:The options \fB\-\-collapse\-range\fP, \fB\-\-dig\-holes\fP, \fB\-\-punch\-hole\fP and
#####
Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
commit 36c370cbf1 adds fstrim_filesystem()
that return -1 or 1 depending on the FTRIM ioctl failures.
The fstrim_filesystem() return codes should not be used as exit codes.
Reported-by: Gwendal Grignou <gwendal@chromium.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
We do not use placeholders (e.g. "-") for missing data in libsmartcols
utils, just use empty space in output.
Signed-off-by: Karel Zak <kzak@redhat.com>
* HAVE_SYS_FS_H is incorrect (should be HAVE_LINUX_FS_H)
* linux/fs.h cannot be included together with sys/mount.h as the both
files define MS_* constants. The libmount.h includes sys/mount.h now.
Signed-off-by: Karel Zak <kzak@redhat.com>
lsmem currently calculates the total online/offline memory by iterating
over all lsmem->blocks. Depending on the lsmem options, there may be
only one lsmem->block, because all sysfs memory blocks could be merged
into one. In this case, the calculation is wrong, because the individual
online/offline state of the sysfs memory blocks is not preserved, but
rather lsmem->blocks[0].state is set to the state of the first sysfs
memory block, typically MEMORY_STATE_ONLINE (at least on s390).
This means that "Total offline memory" will always be calculated as 0
in such cases, e.g. when using "lsmem --summary", or any options that
would merge the table output to one line, like "lsmem -o RANGE":
~# lsmem --summary
Memory block size: 1G
Total online memory: 20G
Total offline memory: 0B
Adding the "-a" option shows the real summary, since there is no block
merging going on, and the calculation is therefore correct:
~# lsmem -a --summary
Memory block size: 1G
Total online memory: 16G
Total offline memory: 4G
Fix this by moving the online/offline calculation into the loop that
is iterating over all sysfs memory blocks, instead of iterating over
potentially merged lsmem->blocks.
Reported-by: Alexander Klein <alkl@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Unfortunately, old version of the file linux/fs.h defines MS_*
macros, so the file cannot be included together with sys/mount.h.
We include sys/mount.h from libmount.h now.
Signed-off-by: Karel Zak <kzak@redhat.com>
When cpu#0 is offline, atof(NULL) is called which causes
a segfault or endless loop depending on implementation
circumstances. So instead of implicitely assumping that the
first cpu is always available, do the presence checks for
all including the first one.
The example given in the man page didn't work. Judging by commit
db663995bd, --inh-caps= used to be called
--caps= but the man page was not updated after the change was made.
* 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux:
tests: use pgrep instead of ps --ppid ...
misc: fix typos using codespell
lsns: fix clang compiler warning
tests: add udevadm settle to sfdisk/resize
build-sys: disable bz2 tarball and fix some am warnings
../sys-utils/lsns.c:360:8: warning: comparison of integers of different signs: '__u32' (aka 'unsigned int') and 'int' [-Wsign-compare]
if (!(NLMSG_OK(nlh, reslen)
^~~~~~~~~~~~~~~~~~~~~
/usr/include/linux/netlink.h:90:24: note: expanded from macro 'NLMSG_OK'
(nlh)->nlmsg_len <= (len))
~~~~~~~~~~~~~~~~ ^ ~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Add a handful of more rare cores. Broadcom Brahma cores are
used in Access Points and Faraday was used on some Network
Storage Devices.
Signed-off-by: Riku Voipio <riku.voipio@iki.fi>