Commit Graph

2119 Commits

Author SHA1 Message Date
Sami Kerola 1c199a6e15 dmesg: link together with syslog(2) manual page
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>
2018-05-03 10:47:01 +02:00
Karel Zak 485241c0a3 Merge branch 'master' of https://github.com/pali/util-linux
* 'master' of https://github.com/pali/util-linux:
  Update information about udf in mount manpage
2018-04-20 10:06:41 +02:00
Karel Zak 031800ff6c umount: add note about --lazy
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>
2018-04-20 09:50:04 +02:00
Pali Rohár 5b95d7b63c Update information about udf in mount manpage 2018-04-19 17:22:49 +02:00
Karel Zak 2d6d789b3a rfkill: use scols_column_set_json_type()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-18 16:08:15 +02:00
Karel Zak 31b2534797 lsns: use scols_column_set_json_type()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-18 16:03:52 +02:00
Karel Zak 8941e5cbb8 lsipc: cleanup columns[] usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-18 15:51:17 +02:00
Karel Zak 46de0fe6e3 losetup: use scols_column_set_json_type()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-18 15:25:20 +02:00
Karel Zak 89f318625c choom: fix build, remove unnecessary include
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-16 13:51:37 +02:00
Karel Zak 8fa223daba choom: new command to adjust OOM-killer score value
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>
2018-04-16 12:53:39 +02:00
Karel Zak dfd3bb8bc2 lscpu: Cortex-A12 merged into Cortex-A17
References: https://community.arm.com/processors/b/blog/posts/arm-cortex-a17-cortex-a12-processor-update
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-12 11:32:17 +02:00
Patrick Steinhardt 74ccba3ed8 rfkill: include <poll.h> instead of <sys/poll.h>
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>
2018-04-11 13:04:53 +02:00
Patrick Steinhardt 23f54ce777 setpriv: implement option to set parent death signal
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>
2018-04-10 13:52:21 +02:00
Karel Zak b8ec0cb4f4 mount: more notes about --options-* to man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-09 12:39:10 +02:00
Karel Zak 815c202c93 Merge branch 'mount-omode' of https://github.com/yontalcar/util-linux
* 'mount-omode' of https://github.com/yontalcar/util-linux:
  mount: use string_to_bitmask()
  mount(8): clarify behavior of --options-mode
  mount: document --options-* in man/help
  mount: added options exposing libmount's optsmode
2018-04-09 12:19:55 +02:00
Bjarni Ingi Gislason 9c56988af6 sys-utils/fallocate.1: Some tidying of the manual
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>
2018-04-06 13:05:58 +02:00
Karel Zak 7afdbb6f07 fstrim: Return EXIT_FAILURE when FTRIM ioctl fails
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>
2018-04-06 12:53:18 +02:00
Karel Zak 6963338ca5 dmesg: fix raw output
The commit 5f538ac40c has introduced
regression ("goto" to the wrong place, so timestamps in raw mode is
not printed at all).

Addresses: https://github.com/karelzak/util-linux/issues/614
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-05 15:59:59 +02:00
Karel Zak 704f9ba6e6 lsmem: improve JSON output
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-05 12:14:46 +02:00
Karel Zak 92368ce179 lsmem: make output more compatible with another utils
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>
2018-04-05 12:02:33 +02:00
Karel Zak 93c2a8b275 lsmem: remove unused variable
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-04-05 11:44:27 +02:00
Vaclav Dolezal 9730aa40cf mount: use string_to_bitmask()
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-03-28 12:26:04 +02:00
Karel Zak 061d1a5109 libmount: include sys/mount.h only if necessary
Addresses: https://github.com/systemd/systemd/issues/8507
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-22 14:05:17 +01:00
Karel Zak 43abda6686 fstrim: cleanup includes
* 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>
2018-03-22 13:17:10 +01:00
Gerald Schaefer 49834246f5 lsmem: fix total online/offline memory calculation
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>
2018-03-20 18:57:07 +01:00
Karel Zak a0357292b5 fstrim: fix fs.h and mount.h collision
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>
2018-03-20 11:42:34 +01:00
Karel Zak dcb22a598d Merge branch 'master' of https://github.com/dirkmueller/util-linux
* 'master' of https://github.com/dirkmueller/util-linux:
  Avoid crash in min/max caculation when cpu#0 being offline
2018-03-19 12:53:22 +01:00
Karel Zak 5109589cc5 mount: (man) be explicit about bind operation
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-03-19 11:46:11 +01:00
Dirk Mueller 95f09bc63c Avoid crash in min/max caculation when cpu#0 being offline
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.
2018-03-17 13:22:13 +01:00
Sam Morris 1aed71e514 setpriv: add example section 2018-03-08 16:31:59 +00:00
Sam Morris a7e6a6b43a setpriv: include --init-groups in the list of options that can be specified with --[re]gid 2018-03-08 16:21:48 +00:00
Sam Morris 64eca6406f setpriv: improve description in man page 2018-03-08 16:21:48 +00:00
Sam Morris 35e953e04a setpriv: fix manpage typo
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.
2018-03-06 17:05:38 +00:00
Yuri Chornoivan 7cd784d006 Fix minor typos on man pages 2018-03-01 16:42:34 +02:00
Steve Kenton bde5d1aa0a mount: (man) update mount options for UDF
Signed-off-by: Steve Kenton <skenton@ou.edu>
Acked-by: Jan Kara <jack@suse.cz>
2018-02-28 13:58:53 +01:00
Masanari Iida 79bd13842b blkzone: Fix a typo in blkzone.8
This patch fixes a spelling typo in blkzone.8

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
2018-02-26 16:42:35 +01:00
Karel Zak f49cf49bd8 mount: add note about cached kernel table for --all
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-22 12:45:56 +01:00
Karel Zak 8e7a0c1622 lsmem: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-20 15:04:51 +01:00
Karel Zak 887810a8a5 lsns: remove if-after-xcalloc
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-20 14:59:40 +01:00
Karel Zak 7595bed189 Merge branch 'maybe-for-v2.32' of https://github.com/rudimeier/util-linux
* '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
2018-02-16 11:25:22 +01:00
Ruediger Meier 73afd3f8e8 misc: fix typos using codespell
Some more funny typos, please review carefully.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-02-16 11:12:52 +01:00
Ruediger Meier 58b29eedb0 lsns: fix clang compiler warning
../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>
2018-02-16 11:12:44 +01:00
Vaclav Dolezal 50ed551992 mount(8): clarify behavior of --options-mode
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-02-14 13:52:04 +01:00
Riku Voipio dd9b4cb320 lscpu-arm: add Faraday And Brahma cores
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>
2018-02-13 15:25:20 +02:00
Karel Zak dd83526ae3 dmesg: use xstrdup() in xalloc.h based util
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-13 10:52:57 +01:00
Vaclav Dolezal 7238285bf2 mount: document --options-* in man/help
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-02-08 15:46:33 +01:00
Karel Zak 8e782a8395 mount: add note about "already mounted" behavior
Addresses: https://github.com/karelzak/util-linux/issues/448
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-05 12:18:49 +01:00
Vaclav Dolezal db9185bf5a mount: added options exposing libmount's optsmode
Added:
--options-mode={ignore,append,prepend,replace}	MNT_OMODE_{IGNORE, ...}
--options-source={fstab,mtab,disable}		MNT_OMODE_{FSTAB,MTAB,NOTAB}
--options-source-force				MNT_OMODE_FORCE

See mnt_context_set_optsmode() documentation for details.

Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-02-01 16:17:37 +01:00
Karel Zak fd777151bf sys-utils: use errexec()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-01 15:44:25 +01:00
Karel Zak 3bf6c44462 fstrim: don't include exitcodes.h
The code uses generic and libmount return codes only.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-02-01 14:49:49 +01:00