Commit Graph

9624 Commits

Author SHA1 Message Date
Karel Zak 32cfe498b8 lsipc: improve --global
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 16c9f32f07 include/xalloc: add err_oom()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 470a7332b3 lsipc: cleanup columns indexes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak be47528713 lsipc: add COMMAND for shmem
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak f6c01f4eed lib/procutils: add proc_get_cmdline()
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 1e0cd7ae9e include/all-io: read_all() don't retry on EOF
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak be333373b5 lsipc: add CTIME to shmem default
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 11:48:09 +02:00
Karel Zak 9d20ffda79 lsipc: new command to list IPC facilities
Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Ondrej Oprala <ooprala@redhat.com>
2015-07-20 11:48:09 +02:00
Stef Walter e36deb6424 agetty: Reprompt once the network addresses change if address displayed
Several of the /etc/issue escape codes such as \4 and \6 depend on
the current addresses of the system that 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.

Similar to the --reload mechanism, if we're displaying an address
in the issue output, and the user hasn't typed anything yet: then
redisplay the prompt with the new address.

We use netlink to watch for address changes. We only open the netlink
socket if we display an address in the issue file.
2015-07-20 11:17:23 +02:00
Sami Kerola 9b83e7a48d logger: do not exit when socket errors are not enforced
The libc openlog(3) does not have error detection whether unix socket
could be opened.  As a side effect that made it possible to use logger
even if syslogd was not running.  Of course user message in these cases
were lost.  This change makes the logger do behave similar way again, so
that sysvinit scripts can successfully pipe messages to logger when ever.

Addresses: https://bugs.debian.org/787864
Addresses: https://bugs.debian.org/790875
Reported-by: Andreas Beckmann <anbe@debian.org>
Reported-by: Andreas Henriksson <andreas@fatal.se>
Tested-by: Robie Basak <robie.basak@ubuntu.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-20 10:54:44 +02:00
Karel Zak 46e43c9860 hwclock: add -D to the man page
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1244609
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-20 10:10:05 +02:00
Karel Zak 26a46f217e Merge branch 'kill-man' of https://github.com/ronin13/util-linux 2015-07-16 11:40:43 +02:00
Karel Zak a6bf40ee77 lslogins: merge read_utmp() code
The code is used only in lslogins, so it does not make sense to
maintain it in libcommon.

Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-16 11:26:14 +02:00
Karel Zak 2b8a9bda07 lslogins: fix --user-accs and --system-accs docs
Reported-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 16:14:32 +02:00
Sami Kerola fe63e9032d bash-completion: cal: add --twelve and --color options
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-07-15 15:51:04 +02:00
Karel Zak 158e418241 ldattach: tiny coding style changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:49:18 +02:00
Tilman Schmidt 58c1746094 ldattach: order line disciplines canonically
List line disciplines in numerical order and put official names
before convenience aliases.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:18 +02:00
Tilman Schmidt 5687494ae0 ldattach: always set line speed and format for N_GIGASET_M101
The Gigaset M101 exhibits particularly awkward and confusing behaviour
when the serial line speed isn't set to what the device expects:
Configuration mode detects the used speed and works anyway, but data
mode silently fails. Troubleshooting this is enormously time-consuming.

Spare the users this trouble by setting the line speed and format to
these devices' factory default values as long as the command line
doesn't say otherwise.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:17 +02:00
Tilman Schmidt b5225af344 ldattach: adapt print_table column width to widest entry
The hardcoded column width of 10 in print_table() is not enough, as
the currently longest table entry to be printed has 12 characters.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
2015-07-15 15:46:16 +02:00
Karel Zak 4bd02cdfdf libfdisk: fix fdisk_label_parse_parttype() for unknown types
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:42:22 +02:00
Karel Zak 5aa8d13b13 libfdisk: (gpt) add missing GUIDs
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 15:02:13 +02:00
Scott Moser b8d07d9bec libfdisk: add GPT GUIDs for PReP
Power Firmware (OFW) scans chosen devices for PReP partition IDs.

Signed-off-by: Scott Moser <smoser@ubuntu.com>
2015-07-15 14:38:03 +02:00
Karel Zak 5adcb6c77f libfdisk: (gpt) fix "MidnightBSD UFS" UUID
Reported-by: Андрей Гаврилин <gaal.dev@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-15 14:29:53 +02:00
Ruediger Meier 7dbcd80ee8 script: evaluate errno only if read() sets it
[kzak@redhat.com: - be careful with errno and DBG
                  - add EINTR check
                  (both suggested by Rudi]

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-03 09:53:05 +02:00
Raghavendra D Prabhu 1c23b1c5d3 kill: Add verbose to man page.
kill adds a verbose option to print the pid(s) and the signal. It is
added to man page here.
2015-07-03 09:11:04 +05:30
Karel Zak e831c87670 script: make sure errno is zero
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-02 10:30:10 +02:00
Karel Zak 048811c97a swapon: fix restart waitpid with errno == EINTR
Reported-by: Maks Naumov (https://github.com/karelzak/util-linux/pull/205)
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-07-01 15:35:17 +02:00
Karel Zak 7015df4936 lib/strutils: make strmode() more generic
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-30 12:41:13 +02:00
Karel Zak f2f731deb8 Merge branch 'sulogin' 2015-06-30 11:21:12 +02:00
Karel Zak 289b153340 fstrim: close dir before exit [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 16:14:35 +02:00
Karel Zak f078134257 rtcwake: cosmetic changes
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 15:19:47 +02:00
Karel Zak bac778c06a rtcwake: fix ARRAY_SIZE() usage
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:46:05 +02:00
Karel Zak 2626f123a5 rtcwake: don't use usage() on error
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:43:41 +02:00
Sami Kerola 76037ac7d8 rtcwake: fix valgrind warning
==3445== Syscall param ioctl(generic) points to uninitialised byte(s)
==3445==    at 0x4F16477: ioctl (in /usr/lib/libc-2.21.so)
==3445==    by 0x402785: setup_alarm (rtcwake.c:231)
==3445==    by 0x403302: main (rtcwake.c:520)

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola f87b73ab44 rtcwake: read accepted mode strings from /sys/power/state
The rtcwake has various mode names that are internal to the command,
listed in rtcwake_mode_string array, while some modes are dynamicaly
listed in /sys/power/state.  Together these form the allowed modes.

[kzak@redhat.com: - cleanup strv usage]

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
2015-06-29 13:39:37 +02:00
Sami Kerola 254e9e58b7 rtcwake: make some command line options mutually exclusive
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 5b4185e17d rtcwake: improve coding style
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 43a44bfc6d rtcwake: add --list-modes
Commit ece44f19f4 missed freeze mode, which
to a simple patch adding the missing argument but Karel pointed out it
would be better to make the rtcwake to tell what arguments are supported
so that possible changes end up to be automatically correct in bash
completion.

Proposed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 067fde32c9 rtcwake: do not overwrite device name
This improves error messaging, and removes a memory leak.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 499a0c7956 rtcwake: clean up struct tm initializations
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 356b2989ae rtcwake: fix preprocessor redefinition
The RTC_AF is expected to be part of linux/rtc.h file.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola a10ce9a3e5 rtcwake: add human readable --date timestamp format
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 3e5a54554d rtcwake: improve read_clock_mode()
Make skipping two lines more robust, and add message about unexpected
adjfile contents when running with --verbose.

Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 5fde2f0d34 rtcwake: remove RTC_ALM_READ and RTC_ALM_SET compatibility
The RTC_WKALM_RD and RTC_WKALM_SET have been available since 2.6.17, and
preferred way since 2007.  Keeping the fallbacks to the old interface is
no longer needed.

Reference: e824290e5d
Reference: f8245c2688
Reviewed-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 64a8067835 rtcwake: replace long if else statement with switch case
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 6e1ec14faf rtcwake: enumerate constant mode strings
Reviewed-by: Karel Zak <kzak@redhat.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 71d95e92c1 rtcwake: add rtcwake_control and remove global variables
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 13:39:37 +02:00
Sami Kerola 14867b0f72 reset: deprecate the script, and remove reset.033c
Most distributions probably ship reset from ncurses, which means
util-linux reset(1) is unlikely to be in use anywhere.  Assuming the
previous being true it is almost unimaginable anyone one would be using
the alternative script, so remove it and mark the script deprecated.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 12:06:22 +02:00
Sami Kerola 694562e3b8 getopt: use $(...) command substitution in example script [shellcheck]
Reference: https://github.com/koalaman/shellcheck/wiki/SC2006
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 12:06:12 +02:00
Sami Kerola 55034ed00e docs: unify mkswap(8) with swapon(8) about holes warning
Reviewed-by: Dave Rutherford <dave@evilpettingzoo.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-06-29 12:06:00 +02:00