Commit Graph

8339 Commits

Author SHA1 Message Date
Sami Kerola 2e0fd22d5d logger: improve readablity of pencode() function
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:18 +01:00
Sami Kerola 4288f9f12c logger: make --stderr print remote server messages
Users wish to see the message should include also remote messages, not
only the one sent to locally via libc function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:18 +01:00
Sami Kerola aab5b44405 logger: add process --id=parent optional argument
When scripts send several messages they will be easier to group together
when parent process id is printed rather than id of the each logger
process.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:18 +01:00
Sami Kerola d9b38f6baf docs: add logger protocol notes to manual page
Inform about rfc5424 support, how to control what it includes to
submission, and that it is the new default when sending syslog messages
to remote server without specifying protocol.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola 4de2e8a038 logger: add rfc5424 support
Add support the more recent syslog protocol and make it default.  The
older BSD syslog protocol can still be used with option --rfc3164.
Protocols are meaningful only when messages are sent to remote syslog
server.

Requested-by: Kodiak Firesmith <ksf@sei.cmu.edu>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola c68a1cb490 logger: tidy up main() by adding small functions and ctl data
Add logger_open(), logger_command_line(), logger_stdin(), and
logger_close() functions, and move all remaining option argument
assignments to control structure.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola cfa77d2643 logger: add function pointer to choose how logging is done
This change paves way to adding support for both RFC 3164 and RFC 5424
syslog protocols.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola 4c3ac8fe52 docs: make logger.1 facilities and levels easier to read
Most people read vertical list a lot quicker than horizontal.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola c462a8caf2 logger: refactor long if clause
When if clause that continues throughout whole function it usually can be
shorten to immediate action, e.g., in this case return on the spot not at
end of the function.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:17 +01:00
Sami Kerola 019b97024f logger: do not rely only getlogin(3) telling who ran the command
The getlogin(3) is known not to always work, and when that happens it is
reasonable to try determine user of name by looking process owner and
passwd information.

Reference: http://man7.org/linux/man-pages/man3/getlogin.3.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:16 +01:00
Sami Kerola d8b616c216 logger: fix indentation issues
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:16 +01:00
Sami Kerola 633493beaf logger: ensure program writes everything to syslog file descriptor
It is fair assumption messages an user is asking to be wrote will be
attempted to be wrote as hard as possible.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-28 21:15:16 +01:00
Stef Walter 6443dd43da agetty: Reprompt and reprint /etc/issue when asked
Add an 'agetty --reload' command which asks all running agetty
commands to display their prompts again.

Several of the /etc/issue escape codes such as \4 and \S depend on
variable data which can change after the agetty prompt is displayed.
This can cause stale data to be displayed when a user looks at a VT,
especially in cases of DHCP racing with system start up.

We never want this to occur once the user has started typing a
user name. So we detect when the user starts typing, after which
no further reprompting occurs after that point.

[kzak@redhat.com: - add #ifdefs to make it usable on non-inotify systems,
                  - use futimens() with NULL timespec
                  - add --reaload to usage()]

Signed-off-by: Stef Walter <stefw-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 16:33:33 +02:00
Sami Kerola 25a365ef5a swaplabel: move swapon-common to include directory
This fixes the following compiler warning.

disk-utils/swaplabel.c:175:2: warning: implicit declaration of function
'get_swap_prober' [-Wimplicit-function-declaration]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:28:05 +02:00
Karel Zak d79654f43d build-sys: add -Wimplicit-function-declaration to compiler warnings
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:26:17 +02:00
Karel Zak 52d92543ff fdisk: fix -l [<device>]
* don't use err(), but warn(), so don't stop after the first error

 * display all errors when "-l <device> ..." specified

 * display only EACCES errors when list whole disks from
   /proc/partitions ("fdisk -l" )

Reported-by: Boian Bonev <bbonev@ipacct.com>
Addresses: https://github.com/karelzak/util-linux/pull/106
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-28 12:07:32 +02:00
Lauri Nurmi 5adf126ef2 hwclock: use pluralized translations. 2014-07-28 11:47:50 +02:00
Lauri Nurmi 140d91471d more: replace ad-hoc support for plurals with gettext plurals. 2014-07-28 11:46:59 +02:00
Lauri Nurmi 58ac82ae2f sfdisk: use pluralized translation. 2014-07-28 11:45:30 +02:00
Benno Schulenberg 6070a9853a various: erase all traces of the long-obsolete ext filesystem
The same argument as for xiafs: dead for over ten years.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:58 +02:00
Benno Schulenberg 556c9c4842 various: erase all traces of the long-obsolete xiafs
The xiafs filesystem was removed from the kernel fifteen years ago,
and any kernel that contained it reached end of life ten years ago.
It's time to stop mentioning it in the mount man page and elsewhere.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:57 +02:00
Benno Schulenberg 00d1cc1ddf docs: improve some wordings in the man page of mount
Also sort the command-line options alphabetically
(with the customary exception of -V and -h).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:55 +02:00
Benno Schulenberg 5e43af7e34 docs: fix some things that were overlooked during the first pass
Mainly more option sorting, some formatting adjustments, and the adding
of a missing --version here and there.

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-28 11:16:53 +02:00
Andreas Henriksson 4f4daf8f90 cfdisk: reenable cursor when quitting
After quitting cfdisk (built with slang) the cursor would be
missing at the command prompt.

Reported-by: Martin Steigerwald <Martin@Lichtvoll.de>
Addresses-Debian-Bug: #755991
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-07-28 11:09:56 +02:00
Andreas Henriksson eee79f2843 tests: Fall back on host/getent in ts_resolve_host
Neither dig or nslookup would be my first option for resolving,
so add the host utility of ISC/bind fame and the (slow) getent
utility shipped with libc.

This extends the conditions introduced in ...

  commit a98de9696e
  Author: Ruediger Meier <ruediger.meier@ga-group.nl>
  Date:   Wed Jun 11 19:28:20 2014 +0200

      tests: skip some last tests if no dns support

... and should help us not skip certain tests when we have
network connection but none of dig or nslookup available.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-07-28 11:09:52 +02:00
Bernhard Voelker ada74f3f32 mcookie: avoid format warning
"gcc (SUSE Linux) 4.8.1 20130909 [gcc-4_8-branch revision 202388]"
issued the following warning:

  warning: format ‘%zu’ expects argument of type ‘size_t’, \
  but argument 3 has type ‘int’ [-Wformat=]

* misc-utils/mcookie.c (main): Change format from %zu to %d.
RAND_BYTES is an enum, thus of type int.

Signed-off-by: Bernhard Voelker <mail@bernhard-voelker.de>
2014-07-28 11:09:49 +02:00
Karel Zak e9b6e76a26 mount: clean up -t info in mount.8 and fstab.5
* remove the huge and unmaintained list of filesystems, just keep
   only very basic FS types in the man pages

 * add info about command delimited lists to fstab.5

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-25 13:08:41 +02:00
Karel Zak 1cd4e61e6c tests: add mount -t test
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-25 12:40:16 +02:00
Karel Zak 64a7e20980 libmount: don't use /{proc,ext}/filesystems when more fs types specified
# mkfs.ext4 /dev/sda1
 # mount -t foo,bar /dev/sda1 /mnt

successfully mount the device, this is unexpected as extN is no
between wanted (by -t specified) filesystems.

Summary about -t:

 * "mount -t foo"        mount(2) with "foo" type

 * "mount -t foo,bar"    try mount(2) with "foo" or "bar"

 * "mount -t foo,auto"   try mount(2) with "foo" or ask libblkid for
                         the type

 * "mount -t nofoo,bar"  try types from /{etc,proc}/filesystems, but
                         exclude "foo" and "bar"

Note that more filesystems may be specified in fstab (as comma
delimited list). The stuff from fstab is always interpreted as list
and never as a pattern ("no" prefix makes no sense in fstab).

Reported-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-25 12:28:34 +02:00
Andreas Henriksson 5cbbdfbfe8 build-sys: fix switch_root/pivot_root cut-n-paste error in configure.ac
The "linux only" check for pivot_root seems to suffer from
a cut-n-paste problem from the earlier switch_root part.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
2014-07-24 12:13:06 +02:00
Benno Schulenberg 09af3db48e textual: fix some typos and inconsistencies in various messages
Fixing plain typos, miswordings, inconsistent periods, some missing
angular brackets, and a proper pluralization (even when it involves
a constant, because for some languages the precise value matters).

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-23 08:56:00 +02:00
Karel Zak a3c74d88e1 swapon: don't print errors as data in smartcols table
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 12:29:38 +02:00
Karel Zak 7c1fa4691f swapon: don't use empty strings for smartcols output
The libsmartcols is smart enough to accept NULL for empty fields
rather than empty strings.

Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 12:24:56 +02:00
Sami Kerola 5db57cfc46 swapon: share get_swap_prober() with swaplabel to print uuid and label
The swapon(8) listing was almost complete, apart from label and uuid.
This change moves the code from swaplabel(8) to shared scope to be used
for printouts in other swap commands, such as swapon.

Adding this feature to lsblk(8) was a consideration, but lsblk is not
interested of swapfiles, so the swapon seems like a better option to add
this information.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2014-07-22 12:17:20 +02:00
Karel Zak bd86cb1679 Merge branch 'rename' of git://github.com/kerolasa/lelux-utiliteetit
* 'rename' of git://github.com/kerolasa/lelux-utiliteetit:
  tests: add rename(1) return value check
  rename: use function pointer to select file or symlink operation
  rename: continue despite something failed
  tests: add rename(1) checks
  tests: use ts_cd everywhere to change direcrory
  tests: add function to change directory reliable way
  rename: allow renaming in subdirectories
2014-07-22 12:12:52 +02:00
Karel Zak ccef45168b Merge branch 'master' of https://github.com/yurchor/util-linux
* 'master' of https://github.com/yurchor/util-linux:
  Fix typos in user visible messages
2014-07-22 12:01:50 +02:00
Karel Zak 3df45c7cdc Merge branch 'ioclt' of https://github.com/lanurmi/util-linux 2014-07-22 11:58:21 +02:00
Karel Zak 1687d0a028 build-sys: release++ (v2.25)
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 11:12:05 +02:00
Karel Zak fdd3a12644 docs: update v2.25-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 11:11:01 +02:00
Benno Schulenberg b59c86c8d5 docs: bring one more man page closer to standard formatting
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2014-07-22 10:43:04 +02:00
Karel Zak e5a367db58 docs: update AUTHORS file
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 10:42:32 +02:00
Karel Zak 055093182d po: merge changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2014-07-22 10:39:11 +02:00
Wylmer Wang f862938183 po: update zh_CN.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Trần Ngọc Quân 528ef7ad40 po: update vi.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Yuri Chornoivan b7b9d9bfb1 po: update uk.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Rafael Ferreira e9a7a47b9a po: update pt_BR.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Jakub Bogusz 984814c55b po: update pl.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Benno Schulenberg 75d401d884 po: update nl.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
Takeshi Hamasaki 1a152bf319 po: update ja.po (from translationproject.org) 2014-07-22 10:33:18 +02:00
David Prévot fb2ab613da po: update fr.po (from translationproject.org) 2014-07-22 10:33:18 +02:00