Commit Graph

916 Commits

Author SHA1 Message Date
Karel Zak cb1caee2ae Merge branch 'master' of https://github.com/rudimeier/util-linux 2014-05-26 12:44:31 +02:00
Ruediger Meier 4e9e0d1e06 lsblk: fix, set default sort_id = -1
Introduced in 642048e4:
 $ lsblk -o SIZE /dev/loop1
lsblk: the sort column has to be between output columns.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2014-05-21 11:59:24 +00:00
Karel Zak 3adaaa154e build-sys: add BUILD_GETOPT
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 13:26:56 +02:00
Karel Zak 15a2c74163 build-sys: add BUILD_{BLKID,FINDFS,WIPEFS,FINDMNT}
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 13:24:21 +02:00
Karel Zak 1b15cbd149 build-sys: add BUILD_{UUIDGEN,CAL,LOGGER,LOOP,MCOOKIE,NAMEI,WHEREIS}
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-21 13:14:48 +02:00
Karel Zak 642048e4a4 lsblk: add --sort <column>
This implementation allow to sort output by arbitrary output column.

Note that output is always converted to human readable strings, but
sort functions in many cases work with original data (stored as
private data to cells by scols_cell_set_userdata()).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-20 15:12:51 +02:00
Karel Zak 293eef71ea Revert "blkid: remove unused variable"
This reverts commit 0fd4b81325.
2014-05-13 09:55:10 +02:00
Sami Kerola 89dda67868 build-sys: remove unnecessary void casts
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:07:12 +02:00
Sami Kerola 4d7d1af674 logger: check numeric priority and facility input values
Earlier use of unknown facility or priority number was accepted, and
resulted in unexpected result.  For example when looking journalctl
--priority=7.8 was converted to priotity 0 and facility 1.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:07:09 +02:00
Sami Kerola 047e2888a3 logger: fail when io vector number exceeds maximum
Earlier version silently failed without logging anything.

$ logger --journald=/etc/services ; echo $?
1

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:07:06 +02:00
Sami Kerola 0fd4b81325 blkid: remove unused variable
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-05-12 13:07:04 +02:00
Benno Schulenberg aa06617f6e textual: remove square brackets from around three dots
Also improve some option descriptions here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-05-06 11:12:13 +02:00
Masatake YAMATO 1b4d2a4a4a lsblk: add -O option to show all available columns
Simple command line for gathering information as many as possible is
useful when understanding a system, especially when trouble shooting.

This patch introduces -O option which enables all available columns.

[kzak@redhat.com: - define collisions between options,
                  - define columns when parse argv[]]

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-05-06 10:56:52 +02:00
Karel Zak edd2af005c uuidd: remove timeout from systemd service file
It seems that SAP does not like the timeout, for performance is
better to keep the daemon permanently running. This is no problem
because uuidd is used only on systems with very unusual requirements
to UUID.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1092039
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-29 10:37:26 +02:00
Karel Zak dade4ff7ae Merge branch 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit
* 'kill-tests-v4' of git://github.com/kerolasa/lelux-utiliteetit:
  lib/procutils: notice setuid() process ownership changes
  lib/procutils: reset errno before strtol() call
  kill: add --verbose option to display what is killed
  tests: check kill all user processes
  tests: check kill print pid option
  tests: check various ways to specify kill signal
  tests: check kill is converting signals names correctly
  tests: add signal receiver program
  kill: remove unnecessary indirection
  kill: make options --pid and --queue mutually exclusive
2014-04-28 11:10:40 +02:00
Sami Kerola d1fd774289 kill: add --verbose option to display what is killed
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 19:04:57 +01:00
Sami Kerola 3665b07cd8 kill: remove unnecessary indirection
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 18:36:40 +01:00
Sami Kerola fe6b5e321f kill: make options --pid and --queue mutually exclusive
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-04-26 18:36:40 +01:00
Karel Zak 24ed078184 wipefs: don't erase nested partition tables by default
It's possible the partition contains a partition table (BSD, or hybrid
boot images). It could be unexpected for users that the lost all (or
another) partitions when work with non-whole disk device. Let's
require --force.

For example:

 # wipefs --all /dev/sdb

erases all including partition table, but on hybrid disk where the
first partition starts at first sector (so partition table is within
the first partition):

 # wipefs --all /dev/sdb1
 /dev/sdb1: ignore nested "dos" partition table on non-whole disk device
 wipefs: Use the --force option to force erase.

asks for --force.

Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1077310
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-24 13:42:54 +02:00
Karel Zak ebff016a19 build-sys: consolidate systemd support
* systemd (since v209) uses only one library (when compiled
   without --enable-compat-libs)

 * all systemd build-sys stuff is merged into HAVE_SYSTEMD
  (automake) and HAVE_LIBSYSTEMD (C macro) now

 * all is controlled by --with-systemd, default is to automatically
   check for systemd libs

 * no more --enable-socket-activation and --enable-journald

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-09 12:23:30 +02:00
Karel Zak e0d4675789 kill: fix bug in --all semantic
Introduces by 2ab6683f59.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 11:29:09 +02:00
Karel Zak 10ab72e7a1 kill: make kill-by-name more obvious in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 11:22:12 +02:00
Karel Zak 6853d664a0 kill: add copyrights, etc.
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 11:12:14 +02:00
Karel Zak a01f4d4323 kill: return 64 on partial success
Return 64 (aka SOME_OK) when more than process specified and the
operation success only for subset of the processes.

 # kill -s 0 firefox mutt xxx; echo $?
 kill: cannot find process "xxx"
 64

We already use this concept for chcpu(8) or mount(8).

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 11:07:00 +02:00
Karel Zak d1f7edbe82 kill: tiny change in man page
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 10:35:30 +02:00
Karel Zak e497557f58 kill: coding style, simplify code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 10:17:23 +02:00
Karel Zak 6ca933136f kill: rename printsig() to print_signal_name()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 10:10:43 +02:00
Karel Zak abc7d9bfdf kill: rename printsignals() to print_all_signalsprint_all_signals()
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 10:03:50 +02:00
Karel Zak dff74debed kill: reorder functions to make it more readable
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-07 09:59:51 +02:00
Karel Zak f9de39eebd Merge branch 'kill' of git://github.com/kerolasa/lelux-utiliteetit
* 'kill' of git://github.com/kerolasa/lelux-utiliteetit:
  kill: move sigqueue inputs to control struct
  kill: add parse_arguments() function
  kill: tell what is wrong rather than output usage()
  kill: use control structure to pass user input to functions
  kill: deprecat invocation as 'pid' command name
  kill: make usage() not to return
  kill: move magic numbers in beginning of the file
  kill: flip all comparions to be in smaller - greater order
  kill: fix coding style
2014-04-07 09:37:34 +02:00
Karel Zak 0925a9dd6c libsmartcols: clean up flags usage
* rename flags functions to scols_table_enable_*
 * rename *_no_foo() functions to _nofoo()
 * output formats are mutually exclusive, so don't use flags there
 * don't assume symbols in scols_new_table(), use scols_table_set_symbols()

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 16:09:57 +02:00
Karel Zak 5c5941df74 lsblk: remove unnecessary code
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak bb6e822ad2 lsblk: clean up data preparation
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:20 +02:00
Karel Zak 85c9ca5adf findmnt: cleanup flags
Let's use one flags variable for everything.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala ba1bf7164f lslocks: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:19 +02:00
Ondrej Oprala 9bd4e5c0bd lsblk: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Ondrej Oprala 218a3a9463 findmnt: use libsmartcols
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2014-04-03 12:29:18 +02:00
Karel Zak 1577b2592e libsmartcols: add columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-04-03 12:29:16 +02:00
Sami Kerola 9e8dffd5cd kill: move sigqueue inputs to control struct
Use of global variables is messy.  The earlier implementation also
assumed queue argument never to be textual, such as 'HUP', which now
works as one might expect.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola fd393d2a02 kill: add parse_arguments() function
Long main() is difficult to read, so moving argument parsing to separate
function should make sense.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola d40c87b0a4 kill: tell what is wrong rather than output usage()
Getting usage as error message is not specific enough.  As a user I want
to know what is wrong, and if it is unclear after error message how to
recover then I run command with --help.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola 2ab6683f59 kill: use control structure to pass user input to functions
This should make it easier to understand how the program works.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola c5b057b342 kill: deprecat invocation as 'pid' command name
Enabling options by renaming command is both unexpected and undocumented.
This magic is now deprecated and with remark of removal of this
functionality in future.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola c840c5023c kill: make usage() not to return
And change the function argument to be an output stream.  Earlier the
--help option made kill exit with none-zero value, that is now corrected.

CC: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola 6e1bffa886 kill: move magic numbers in beginning of the file
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:36 +01:00
Sami Kerola 80af5fb046 kill: flip all comparions to be in smaller - greater order
This makes code more readable.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:35 +01:00
Sami Kerola d4ea8636ad kill: fix coding style
The kill was deprecated at the time lot of other tools got style
unification.  Now when deprecation is lifted it is time to get kill
cleaner.  This commit does not modify code, only various spacing issues,
removal of unecessary braces, and such are dealt.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-03-30 21:32:35 +01:00
Karel Zak c48508c2fa findfs: add ability to work with PART{UUID,LABEL}= too
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-28 10:36:05 +01:00
Sami Kerola 753d9bb2ec findfs: use symbolic exit values, and tell about them in manual
[[kzak@redhat.com: - move return codes to findfs.c]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-26 12:17:36 +01:00
Sami Kerola f7bac5731b mcookie: add --max-size option
Just in case someone wants to add entropy from device with invocation
demonstrated below.

$ mcookie --file /dev/urandom --max-size 64k

[kzak@redhat.com: - use all-io.h]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-03-26 12:08:57 +01:00