Sami Kerola [Sun, 11 May 2014 19:26:42 +0000 (20:26 +0100)]
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.
Sami Kerola [Sun, 11 May 2014 19:26:39 +0000 (20:26 +0100)]
cytune: remove from util-linux
Assumption is there are not many who need this tool. Whom ever they
might be the recommendation is to use the command from old util-linux
release. Second reason to removal is difficulty to test hardware
specific command when none of the active project members does not seem to
have such. Basically the command has reached dead end what comes to
maintainability of it.
Sami Kerola [Sun, 11 May 2014 19:26:38 +0000 (20:26 +0100)]
tests: check /proc availability, and go-around if it is incomplete
Unavailability of /proc is fatal for kill, and continuing with the test
in that case does not make sense as it will only mean false positive
errors.
Where /proc/<pid>/status file(s) does not exist the check will perform
opportunistic sleep with assumption the test_sigreceive will be ready to
be killed if it has some time to init.
[kzak@redhat.com: - remove dependence on gawk, just use shell
- fix typo in "test /proc"]
CC: Ruediger Meier <sweet_f_a@gmx.de>
Reference: https://travis-ci.org/rudimeier/util-linux/jobs/24561058 Signed-off-by: Sami Kerola <kerolasa@iki.fi> Signed-off-by: Karel Zak <kzak@redhat.com>
Karel Zak [Mon, 12 May 2014 10:32:33 +0000 (12:32 +0200)]
Merge branch 'tests-features' of https://github.com/rudimeier/util-linux
* 'tests-features' of https://github.com/rudimeier/util-linux:
tests: style Makefile and make output
tests: allow to add or override test suite options
tests: add exit case "KNOWN FAILED"
tests: fix var names
tests: allow test options to be overridden by env
tests: call ts_init_env as early as possible
Ruediger Meier [Sat, 10 May 2014 01:57:26 +0000 (03:57 +0200)]
tests: add exit case "KNOWN FAILED"
Now we can mark tests as known to be broken without bothering
users with exit failure. In the build log this "KNOWN FAILED"
may be interpreted as TODO ;)
The main advantage of "known-fail" instead of just skipping
is that we will still find the test diff.
Ruediger Meier [Sat, 10 May 2014 00:00:53 +0000 (02:00 +0200)]
tests: allow test options to be overridden by env
Specially for automated builds the user may want to have some
fine granulated influence like
export TS_OPT_libmount_verbose="yes"
export TS_OPT_ipcs_fake="yes"
export TS_OPT_ipcs_limits2_fake="no"
if <big endian> then
export TS_OPT_hexdump_fake="yes"
fi
make check
Even for interactive developers this could be useful for example to
debug just one particuar test while having a regular run with stress:
Ruediger Meier [Thu, 8 May 2014 15:45:31 +0000 (17:45 +0200)]
last: --time-format=full should do the same like -F
For no reason "full" did something else than "iso" or -F as you
see here:
$ ./last -f ../tests/ts/last/wtmp.LE --time-format=full | grep -A2 "no logout"
torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout
reboot system boot system-name Wed Aug 28 20:00:00 2013 still running
reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00)
$ ./last -f ../tests/ts/last/wtmp.LE --time-format=iso | grep -A2 "no logout"
torvalds linux hobby 1991-08-26T02:57:08+0200 gone - no logout
reboot system boot system-name 2013-08-28T20:00:00+0200 still running
reboot system boot system-name 2013-08-28T18:00:00+0200 - 2013-08-28T19:00:00+0200 (01:00)
$ ./last -f ../tests/ts/last/wtmp.LE -F | grep -A2 "no logout"
torvalds linux hobby Mon Aug 26 02:57:08 1991 gone - no logout
reboot system boot system-name Wed Aug 28 20:00:00 2013 still running
reboot system boot system-name Wed Aug 28 18:00:00 2013 - Wed Aug 28 19:00:00 2013 (01:00)
Also note the useless leading space before "gone"
The only thing which matters is fmt->out width when printing these
strings like "still running". Now ctl->fulltime flag is unsused and
removed.
Sami Kerola [Sun, 4 May 2014 15:39:38 +0000 (16:39 +0100)]
column: inform user when multibyte conversion error occurs
The column(1) read input until conversion error, and used incomplete
input when outputing, that made at least me to wonder where the rest
disappeared without explanation. IMHO it is better to fail immediately
rather than do only half of the task.
Ruediger Meier [Tue, 6 May 2014 17:16:53 +0000 (19:16 +0200)]
tests: fix kill problems
There were several failures (missing tmp files, missing pids) on travis
build farm which I couldn't track down completely. Here we fix some
possible issues:
- mktemp -u is unsafe, maybe even in practice if there is a bad random
generator
- make sure that mktemp does not give us pure integer filnames which
would not work for "kill by-name"
- avoid using trap, could be that it removed tmp files on wrong signals
Sami Kerola [Wed, 23 Apr 2014 22:32:11 +0000 (23:32 +0100)]
last: fix is_phantom() detection
The /proc/<pid>/loginuid is not always available, and when so a running
session should not be determined to be gone. This is a regression from
commit mentioned in reference.
Sessions that have started before previous system boot, and did not log
out meanwhile, will be marked as gone. It is fair to say that these
sessions are most likely result of a wtmp corruption.
Karel Zak [Tue, 29 Apr 2014 08:37:26 +0000 (10:37 +0200)]
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>
Karel Zak [Mon, 28 Apr 2014 09:10:40 +0000 (11:10 +0200)]
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
Sami Kerola [Sun, 20 Apr 2014 09:36:05 +0000 (10:36 +0100)]
lib/procutils: notice setuid() process ownership changes
Earlier the owner of a process was determined by owner of the
/proc/<pid>/stat file. When changes user ID privileges with setuid() the
stat file ownership is not updated, that resulted kill(1) to consider
such processes where running using same uid as the present process.
Sami Kerola [Tue, 15 Apr 2014 10:54:21 +0000 (11:54 +0100)]
lib/procutils: reset errno before strtol() call
When going through /proc the last entry made readdir() to alter errno,
which made the strtol() to think something went wrong, resulting kill(1)
tests to fail when running in --parallel mode.
Karel Zak [Thu, 24 Apr 2014 11:42:54 +0000 (13:42 +0200)]
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>
FIXME
Units KB, MB, GB, etc. are ambiguous (not necessarily used here)
Prefixes kilo, mega, giga, etc. are ambiguous with the unit byte (ditto)
Change ' \- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)
Change ' - ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)
Change '\-' to '-' (code "hyphen-minus", rendered with the glyph
hyphen in troff), if it is a part of a compound name.
A minus is not used in words. People using UTF-8 and copy-and-paste
can(?) (may?) use "info", "man --ascii" or the command "man" should
have an option to display the '-' ("hyphen-minus") in names of options
with the code (character name) "hyphen-minus" (u002D) instead of
"u2010" (code (character) name "hyphen").
Change '-' to '\-', if it indicates an option
Protect a full stop (.), that begins or ends a string, with \&
Correct space between sentences to two space characters (or begin
each sentence on a new line).
Change '--' to '\-\-', if it indicates an option
Add \~ (no-break space) around '|' (means "or")
Change ' -- ' to ' \(en ' (an en-dash), if it is a dash (pause,
separation)