Commit Graph

12142 Commits

Author SHA1 Message Date
Karel Zak 7b41ad363f lib/signames: fix redefinition of 'sys_signame' on OSX
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 15:17:10 +02:00
Karel Zak 525a0ab2f5 unshare: cleanup if-if code
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 13:19:59 +02:00
Karel Zak c61e986fd0 lib/signames: remove signame array from header file
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-23 13:18:57 +02:00
Karel Zak c5910c7f27 Merge branch 'kill-child-feature' of https://github.com/nh2/util-linux
* 'kill-child-feature' of https://github.com/nh2/util-linux:
  unshare: Allow passing <signame> to --kill-child
  unshare: Add --kill-child option.
  signames: Make input char buffers const
  kill: Extract signal names into signames.h/signames.c
2017-10-23 12:58:21 +02:00
Karel Zak b41bac08ab build-sys: move rfkill to /usr/sbin
The original implementation uses sbin, let's do it too.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 14:59:16 +02:00
Karel Zak c774252a46 tests: update lsmem
* add --split

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 14:33:47 +02:00
Karel Zak d12e945dbf lsmem: add --split
Now the way how lsmem lists memory ranges is affected by used output
columns.  It makes it very difficult to use in scripts where you want
to use for example only one column

	ranges=$(lsmem -oRANGE)

and in this case all is merged to the one (or two) huge ranges and all
attributes are ignored. The --split allows to control this behavior

	ranges=$(lsmem -oRANGE --split=STATE,ZONES)

forces lsmem to list ranges by STATE and ZONES differences.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak 87a24d85f5 lsmem: add hint about block merges to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak 9c41d2701f lsmem: improve path_read_xxx() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak 96b6448d5d chmem: cleanup usage()
Just to be compatible with another u-l tools.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Andre Wild afee3f2042 lsmem/chmem: add memory zone awareness to bash-completion
This patch extends the valid --output values with ZONES for the
lsmem bash-completion, and adds the --zone option for the chmem
bash-completion.

Signed-off-by: Andre Wild <wild@linux.vnet.ibm.com>
Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Gerald Schaefer 0a4320f5e7 tests/lsmem: update lsmem test with ZONES column
The existing s390 and x86_64 dumps already contain the valid_zones sysfs
attribute, so just add a new "lsmem -o +ZONES" test command and update
the expected results.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Gerald Schaefer 60a7e9e94e lsmem/chmem: add memory zone awareness
With this patch, valid memory zones can be shown with lsmem, and chmem can
set memory online/offline in a specific memory zone, if allowed by the
kernel. The valid memory zones are read from the "valid_zones" sysfs
attribute, and setting memory online to a specific zone is done by
echoing "online_kernel" or "online_movable" to the "state" sysfs
attribute, in addition to the previous "online".

This patch also changes the default behavior of chmem, when setting memory
online without specifying a memory zone. If valid, memory will be set
online to the zone Movable. This zone is preferable for memory hotplug, as
it makes memory offline much more likely to succeed.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
2017-10-20 12:37:04 +02:00
Karel Zak c08396c769 libmount: use eacess() rather than open() to check mtab/utab
The open() syscall is probably the most strong way how to check write
accessibility in all situations, but it's overkill and on some
paranoid systems with enabled audit/selinux. It fills logs with
"Permission denied" entries. Let's use eaccess() if available.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-20 12:37:04 +02:00
Karel Zak 27e66e59a3 build-sys: release++ (v2.31)
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:08:49 +02:00
Karel Zak 568624d577 docs: update v2.31-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:06:00 +02:00
Karel Zak 9155d035e4 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 13:00:06 +02:00
Karel Zak 08b1bd5103 po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-19 12:57:57 +02:00
Sebastian Rasmussen 20fc15cfec po: update sv.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Rafael Fontenelle ddc20b9ebd po: update pt_BR.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Jakub Bogusz cf68f67792 po: update pl.po (from translationproject.org) 2017-10-19 12:53:09 +02:00
Sami Kerola 9e33cddd94 rfkill: fix description name typo
Commit 7d2a9960ad made gps to look like a GUID Partition Table.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2017-10-17 10:15:21 +02:00
Karel Zak beaca64a6c blkid: improve man page wording
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 23:26:45 +02:00
Karel Zak 27fbfef33c blkid: more info about ambivalent results to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 12:01:41 +02:00
Karel Zak 12786a9015 blkid: cleanup man page info about lsblk
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 11:45:41 +02:00
James Sanford e1b1c7b082 zramctl: fix show all non-zero zram devices
Addresses: https://github.com/karelzak/util-linux/issues/521
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-16 11:04:03 +02:00
James Sanford 4847bb5ee9 zramctl: remove unused ZRAM_EMPTY and blank line 2017-10-14 00:57:05 -07:00
Niklas Hambüchen 8b39a17c3b unshare: Allow passing <signame> to --kill-child 2017-10-14 04:46:13 +02:00
Niklas Hambüchen 8e8f0fa59a unshare: Add --kill-child option.
This allows to conveniently kill the entire process tree
below the forked program, a common problem when scripting
tasks that need to reliably fully terminate without leaving
reparented subprocesses behind.

The example added to the man page shows the most common use.

Implemented using prctl(PR_SET_PDEATHSIG, ...).
2017-10-14 04:46:13 +02:00
Niklas Hambüchen b6e1977db4 signames: Make input char buffers const 2017-10-14 04:46:13 +02:00
Niklas Hambüchen 6855f6e80b kill: Extract signal names into signames.h/signames.c 2017-10-14 04:46:13 +02:00
Karel Zak dec4fae21b rfkill: fix typo [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:53:32 +02:00
Karel Zak e9aa2a14b0 losetup: fix bitwise vs. logical typo [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:45:11 +02:00
Karel Zak 9d4f78ef0e ipcs: fix memory leak [coverity scan]
It's not important, but let's keep static analyzes happy.

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:39:54 +02:00
Karel Zak 2d4c226dfb logger: keep header generators independent on connection
* avoid memory leaks
* don't use incomplete or header after free()

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 14:21:27 +02:00
Karel Zak 5794087292 fincore: make sure mmap(NULL, ...) [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 12:44:55 +02:00
Karel Zak f086478af4 libsmartcols: (sample) cleanup line separator usage
* add comment to explain when nolinesep flag is necessary
* force to print \n before switch to the next line to support

	  ./sample-scols-continuous > file

use case.

Addresses: https://github.com/ignatenkobrain/python-smartcols/issues/18
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 12:03:57 +02:00
Karel Zak 1e46776263 libsmartcols: (docs) add note about line separators
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-12 11:33:49 +02:00
Karel Zak be64282665 lslogins: fix possible memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 15:13:44 +02:00
Karel Zak a30f2a9b7a libsmartcols: don't call free_buffer() for uninitialized variable [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 15:06:41 +02:00
Karel Zak 78c57214ad libmount: make sure we call stat() propely [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:59:16 +02:00
Karel Zak ee7f1e9e08 libfdisk: (sun) make math more robust [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:50:43 +02:00
Karel Zak 1458c5c750 lib/pager: check open() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:42:49 +02:00
Karel Zak 4bb91e84ff lib/mbsedit: check wctomb() return code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 14:40:37 +02:00
Karel Zak e92d55e6cb logger: allow to reconnect on initial failed connect too
The current code sets noact flag if unix socked connection failed. This is ugly.
We want to reconnect always in all cases (well, except --socket-error=on).

Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-11 12:35:24 +02:00
Karel Zak 87ac63c9fa logger: add dummy fallback for OSX
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-10 14:45:55 +02:00
Karel Zak caf6ac6e59 logger: reconnect on failed send()
The libc syslog() reconnects on failed send(). We need the same thing
as logger(1) is expected as long time running tool. For example
recommended Apache configuration is:

	ErrorLog "| /usr/bin/logger -t apache_error -p local6.debug"

The issue is that connection endpoint (e.g. syslogd) maybe restarted.
The simple way how to test is:

	for i in $(seq 0 3600); do echo "This is message number $i"; sleep 1; done | logger --tcp --server 127.0.0.1 --port 514

and restart your syslog. The current implementation gets SIGPIPE or
write warning message, but it never reconnect.

Addresses: https://github.com/karelzak/util-linux/issues/363
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-10 13:56:30 +02:00
Karel Zak 55833ba9b2 Merge branch 'mount-typo' of https://github.com/Liam-Ryan/util-linux
* 'mount-typo' of https://github.com/Liam-Ryan/util-linux:
  Fixed typo in mount.8
2017-10-10 12:52:19 +02:00
Karel Zak 1f06d754be setsid: document fork(2) usage
Addresses: https://github.com/karelzak/util-linux/issues/518
Signed-off-by: Karel Zak <kzak@redhat.com>
2017-10-10 12:06:58 +02:00
Liam Ryan cf41837f57 Fixed typo in mount.8
Signed-off-by: Liam Ryan <liamryandev@gmail.com>
2017-10-09 17:41:42 +01:00