Commit Graph

9927 Commits

Author SHA1 Message Date
Karel Zak 8ff3d5d077 lsns: fix usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:50:51 +01:00
Karel Zak 635493655e lsns: add details to the man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 13:00:14 +01:00
Karel Zak 1880a5781f lsns: sort namespaces, avoid duplicate entries in tree output
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 12:31:40 +01:00
Karel Zak 82a437c79d lsns: remove unwanted comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:45:11 +01:00
Karel Zak 1bb4fe24e3 lsns: add man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-12-01 11:40:51 +01:00
Karel Zak 304fbe8b3c lsns: filter by NS type
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 15:55:31 +01:00
Karel Zak 969d3d15aa lsln: allows to list namespace processes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 14:06:05 +01:00
Karel Zak c600d82a3a libsmartcols: make sure we have space for ascii art
* more verbose output about columns width counting
* strlen_line() does not care about space between columns and extra
  tree ASCII art. Let's assume that all termwith is possible to use
  for this extra stuff, it means that maximal buffer size is
  biggest_line + termwidth.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 12:53:42 +01:00
Karel Zak 440f73b7bc libsmartcols: allow to reduce tree columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-30 11:43:05 +01:00
Karel Zak 9dfd601976 lsns: read all processes when --task specified
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 14:24:09 +01:00
Karel Zak 13f6b9db1e build-sys: add lsns to gitignore
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:57:22 +01:00
Karel Zak a52852d37a lsns: add USER and UID
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:31 +01:00
Karel Zak 04a5cb58b6 namei: move icache to lib/
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-27 13:56:01 +01:00
Karel Zak 8a2045620e lsns: new command
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-26 14:09:45 +01:00
Karel Zak 0e756daeb6 lslocks: use stuff from lib/procutils
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-25 14:17:22 +01:00
Karel Zak 5184d93630 agetty: don't ignore netlink on select()
agetty uses NETLINK_ROUTE to be notified about network interface
changes. Unfortunately, the code that monitor the netlink FD does not
increment number of the monitored file descriptors when call
select(2), so the netlink notifications are invisible for agetty.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1278906
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-24 17:44:38 +01:00
Karel Zak 0172ebba52 tests: update ZFS test
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 19:08:00 +01:00
Casper Ti. Vector dcbba45cc5 include: remove now useless linux_reboot.h. 2015-11-19 12:07:41 +01:00
Casper Ti. Vector e52b58e627 ctrlaltdel: use reboot() provided by libc, assuming it is 1-adic. 2015-11-19 12:07:04 +01:00
Karel Zak f98d9641a3 losetup: clean up --direct-io
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-19 11:57:05 +01:00
Ming Lei faeef4d2e9 losetup: support list direct io
So that user can see if DIO is set for current loop device.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Ming Lei 64c3bb3cb7 losetup: support ioctl cmd of LOOP_SET_DIRECT_IO
From v4.4, linux kernel starts to support direct I/O and
AIO to backing file for loop driver, so allow losetup to
enable the feature by using LOOP_SET_DIRECT_IO ioctl cmd.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
2015-11-19 11:27:36 +01:00
Karel Zak 710dd49239 blkid: don't mark zfs as RAID
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-18 11:55:35 +01:00
Andreas Henriksson 42f536ee84 bash-completion: fstrim: use mountpoint, not device
fstrim takes mountpoint as argument but the bash completion
was completing it to a device node.

Addresses: http://bugs.debian.org/804833
Reported-by: Ritesh Raj Sarraf <rrs@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2015-11-13 09:52:14 +01:00
Benno Schulenberg 25b3c04f41 lsipc: tweak a few wordings on the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg 1e6a9c1814 chfn: improve formatting and wording of the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg e8cf378e48 hexdump: fix a typo and tweak some wordings in the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg 239610b659 dmseg: slightly improve punctuation and formatting of the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg da6bb5f8c3 logger: sort the options in the manpage alphabetically
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Benno Schulenberg 05e68ce728 logger: improve grammar and formatting of the manpage
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2015-11-09 10:03:58 +01:00
Sami Kerola a4aeb5bd80 script, hwclock: check file exist with access(3) rather than stat(3)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola c3a9f86fcd agetty: fix chown(3), chmod(3) and open(3) race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola d0a050e0f9 fsck: retire stat(3) when access(3) does better job
The stat(3) and access(3) are in this case almost interchangeable, so choose
the lightweight function with additional advantage checking the file is
executable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola 8df370d340 swapon: fix stat(3) and open(3) race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola a64e268224 login: fix stat(2) race
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-09 09:56:14 +01:00
Sami Kerola 2ec100a180 logger: shadow declaration
misc-utils/logger.c:448:17: warning: declaration of 'msg' shadows a
				parameter [-Wshadow]
misc-utils/logger.c:429:74: note: shadowed declaration is here

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-11-06 13:19:39 +01:00
Karel Zak 803172f63d prlimit: cleanup output units
The change is based on kernel fs/proc/base.c.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-05 18:59:00 +01:00
Karel Zak 3ccd9664aa bash-completion: add cal --span
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-05 11:34:25 +01:00
Karel Zak a29edd057c Merge branch 'cal-span' of https://github.com/Deiz/util-linux
* 'cal-span' of https://github.com/Deiz/util-linux:
  cal: Add --span option
  cal: Track date span independently from months_in_row
2015-11-05 11:32:10 +01:00
Karel Zak b0e6b25e64 build-sys: bump also PACKAGE_VERSION_RELEASE number
Now we bump only PACKAGE_VERSION_MAJOR and PACKAGE_VERSION_MINOR
numbers. The PACKAGE_VERSION_RELEASE is always zero.

These numbers are used for LIBxxx_VERSION strings and Version: field
in the .pc files.

Unfortunately, if we keep PACKAGE_VERSION_RELEASE= always zero then
our bugfix releases are invisible for pkg-config.

(Although I don't think it's good idea to depend in code on any
 library bugfix release, code should be about APIs).

Addresses: https://github.com/systemd/systemd/pull/1754
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-11-04 17:19:41 +01:00
Karel Zak 4419ffb9ef lib/sysfs: make sysfs_get_devname()/blkid_devno_to_wholedisk() more robust
Now the function uses result buffer for internal stuff (readlink), so
it requires that the buffer is large enough. This is unexpected as
caller assumes that the buffer has to be large enough for devname only.

References: http://www.spinics.net/lists/util-linux-ng/msg12015.html
Reported-by: Tom Yan <tom.ty89@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-30 11:08:32 +01:00
Karel Zak 9b28da2d1f logger: remove unnecessary comment
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-29 11:32:50 +01:00
Karel Zak 27a9eb5359 logger: use --id as local socket credentials
If you have really paranoid syslog (or systemd who listens on /dev/log)
then it replaces in the message PID with a real PID from socket header
credentials:

 # echo $PPID
 1550

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:22:13 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:22:13 ws kzak[22100]: This is message baby!
                         ^^^^^

This patch forces kernel to accept another *valid* PID if logger(1)
executed with root permissions; improved version:

 # logger -p info --stderr --id=$PPID "This is message baby!"
 <14>Oct 29 11:26:00 kzak[1550]: This is message baby!

 # journald -n 1
 Oct 29 11:26:00 ws kzak[1550]: This is message baby!

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-29 11:18:21 +01:00
Karel Zak 17c8aa1dc0 logger: use iovec for all message
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-27 18:44:00 +01:00
Karel Zak 94a28496aa logger: use iovec and sendmsg() to send message
The iovec based solutions allow to send multiple strings by one
syscall (for example additional \n messages separator). We can also
use it to send additional socket header metadata (e.g.
SCM_CREDENTIALS) later.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-27 13:19:16 +01:00
Karel Zak da0c95128c Merge branch 'uuid' of git://github.com/kerolasa/lelux-utiliteetit
* 'uuid' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add uuidd output check
  tests: add uuidgen output check
  tests: make test_uuid_parser to read files
  tests: add uuid parser check
2015-10-27 12:01:22 +01:00
Karel Zak 741d478eeb ctrlaltdel: use path.h to read /proc
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-10-27 11:56:51 +01:00
Sami Kerola 244d48331e
tests: add uuidd output check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 20:17:07 +01:00
Sami Kerola 4bd90ec864
tests: add uuidgen output check
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 20:17:01 +01:00
Sami Kerola 85638702ed
tests: make test_uuid_parser to read files
This allows using the command to check uuidgen and uuidd are generating
valid outputs.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-10-18 19:12:30 +01:00