Commit Graph

2209 Commits

Author SHA1 Message Date
Andreas Henriksson 0f7a57f58b fstrim: Add Documentation key to fstrim.service 2018-11-21 10:47:40 +01:00
Sami Kerola 7004da3d73 fstrim: use long options in systemd service file
Long options are more user friendly.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2018-11-21 10:47:14 +01:00
Laurent Vivier f0af42b517 unshare: allow to set user ID and group ID
This patch introduces two new parameters to set the
user ID and the group ID of the program to be executed.
Setting group ID also drops supplementary groups.

The option names used are the same as for nsenter,
-S, --setuid and -G, --setgid.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2018-11-12 11:52:15 +01:00
Laurent Vivier bf8834d4f4 unshare: allow to set a new root
This patch instroduces two new parameters to set the new
root and the new working directory in this new root.

This allows to combine "unshare chroot" in one command,
and doing like this the /proc filesystem is correctly
mounted in the new root with "--mount-proc".

The new parameters are -R, --root and -w, --wd. The names
are the same as for nsenter, except for "-r" that is already
used by "--map-root-user" and replaced by "-R".

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2018-11-12 11:52:14 +01:00
Justin Chen e1686b25ac rtcwake: use poweroff if shutdown is not found
Some systems do not have the shutdown command. Use poweroff as an
alternative.

Signed-off-by: Justin Chen <justinpopo6@gmail.com>
2018-11-06 12:34:02 +01:00
Karel Zak a6f99be447 eject: use err() rather than abort()
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1645920
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-11-05 10:35:24 +01:00
Masato Suzuki 8a7f4b5bfe blkzone: fix report zones sector offset check
To catch an offset error, an offset should be begger than or equal to
a device size in the condition.

Signed-off-by: Masato Suzuki <masato.suzuki@wdc.com>
2018-10-23 11:49:41 +02:00
Karel Zak f1a7a86d1b mount: add note about MS_BIND and _netdev
Addresses: https://github.com/karelzak/util-linux/issues/697
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-10-02 12:50:40 +02:00
Karel Zak da6392177d unshare: remove -s from --help output
The code and man page do not assume -s to be short alias to
--setgroups.

This commit also a little bit change --help output formatting to make
it more readable and structured.

Addresses: https://github.com/karelzak/util-linux/pull/692
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-11 12:47:39 +02:00
Matti Niemenmaa f1a7cfcb1d fallocate: add missing semicolon
This broke compilation when HAVE_POSIX_FALLOCATE was undefined. The typo
dates to the original posix_fallocate support added in commit
833f9a7aae.

Signed-off-by: Matti Niemenmaa <matti.niemenmaa+git@iki.fi>
2018-09-10 15:25:16 +03:00
Karel Zak 350f5c8df2 lscpu: use the first VM from /proc/sysinfo
Addresses: https://github.com/karelzak/util-linux/issues/685
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 14:30:37 +02:00
Karel Zak d0b75b03bc lscpu: make xasprintf call more robust
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-09-04 13:12:34 +02:00
Karel Zak 89f9542574 setpriv: add --reset-env
Clear environment in way like su(1), but PATH is set to hard-coded
defaults and /etc/login.defs is not used at all (I guess we want to
keep setpriv(1) simple).

If you need anything more advanced than use env(1).

Addresses: https://github.com/karelzak/util-linux/issues/325
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-22 11:43:32 +02:00
Karel Zak 99179a0a08 setpriv: add user/group names to usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-22 10:35:51 +02:00
Karel Zak 85c15c1f61 setpriv: allow to use group name for --groups
Addresses: https://github.com/karelzak/util-linux/issues/325
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-22 10:29:09 +02:00
Karel Zak 26b6525a51 fstrim: use -n shortcut for --dry-run
It seems 'n' is more common than 'd'. The patch also cleanup
getopt_long() options string.

Addresses: fda0e2cf04 (commitcomment-30097920)
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-16 14:00:45 +02:00
Jakub Wilk b9c3b903fe Fix man page typos
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
2018-08-16 11:09:15 +02:00
Karel Zak df5ccf2589 build-sys: fix typo in man install
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-15 11:47:17 +02:00
Karel Zak b939b6465f docs: add adjtime_config(5) man page
The file is pretty common, but undocumented by individual man page.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-14 14:53:14 +02:00
Mark Sheppard e6601a70ec lscpu: fixed part ID for ARM Cortex-M7 2018-08-13 16:45:01 +01:00
Karel Zak d901e4275f mount: add ext4 to some places to the man page 2018-08-10 16:27:41 +02:00
Karel Zak 784e9d9e2e losetup: add reference to suffixes for --{sizelimit,offset}
Reported-by: Milan Broz <gmazyland@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-08 13:12:27 +02:00
Karel Zak 0d73ea8bf9 fstrim: update .service to follow /etc/fstab
Replace -a with -A to discard mounted filesystems from /etc/fstab. The
original -a forces fstrim to try to discard all filesystems, including
for example manually mounted removable media.

It seems better for widely used .service unit to follow /etc/fstab.

Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-08 11:35:58 +02:00
Karel Zak 0554182555 setarch: make <arch> optional
Let's allow to change personality flags without execution domain
modification.

Old way:
  setarch `arch` --addr-no-randomize myprog

New way:
  setarch --addr-no-randomize myprog

Addresses: https://github.com/karelzak/util-linux/issues/668
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-07 11:31:14 +02:00
Karel Zak 1db8bf9378 setarch: split set_arch() function to small functions
It seems better to keep the code more flexibile by small one-purpose
functions than by one huge monster.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-06 16:32:36 +02:00
Bjarni Ingi Gislason 559ee54af1 man pages: Fix misuse of two-fonts-macros (BR, IR)
Change a two-fonts-macro to the single font one, when there is only
one genuine argument.

  Split a punctuation mark from the only argument to a two-fonts-marco.

  Remove an isolated two-fonts-macro.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Bjarni Ingi Gislason 934a6fa80b man pages: Remove "left" (or change to "l") in the column formats of tables
A developmental version of "groff" issued a warning, for example with
"test-groff -b -e -mandoc -T utf8 -rF0 -t -w w -z":

troff: <logger.1>:299: warning: can't find font 't'

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
2018-08-06 08:58:57 +02:00
Karel Zak 0dcb713f2e hwclock: rely on kernel for RTC_UIE_ON on Aplha and Sparc
It's kernel business to return EINVAL for unsupported RTC_UIE_ON. We
(userspace) should not make decisions about things that we do not
control.

If kernel is wrong then fix the kernel, don't hide the problem by
crazy ifdefs in userspace.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-03 13:08:21 +02:00
Karel Zak d5fd9ac6b2 umount: add --quiet option
The command umount supports things like --all-targets and --recursive
to umount all nodes in specified tree. Sometimes it makes sense to
aggressively use wildcards like /dev/sdb* and in this case --quiet
seems like a good choice

	umount --quiet --all-targets /dev/sdb*

to suppress 'not mounted' error messages. The new option suppress only
these error messages and nothing else.

Addresses: https://github.com/karelzak/util-linux/issues/672
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 09:10:07 +02:00
Karel Zak 3e48ef72c1 lscpu: add 'Address sizes'
Addresses: https://github.com/karelzak/util-linux/issues/674
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-08-01 08:33:32 +02:00
Karel Zak c5b8909f13 fstrim: add -A|--fstab to trim according to /etc/fstab
Addresses: https://github.com/karelzak/util-linux/issues/673
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 16:38:59 +02:00
Karel Zak 72213916c3 fstrim: add control struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 15:58:49 +02:00
Karel Zak 6df5c6d4e0 hwclock: remove ntpd from man page
It seems better to use generic "NTP daemon" in the man page than
points to specific ntpd(1) implementation as some distros use for
example chronyd(1) rather than old ntpd(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-31 11:07:47 +02:00
Karel Zak d29b7ced3b lscpu: fix resource leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-25 12:02:28 +02:00
Karel Zak 9c6af25c31 losetup: fix mem leak, improve code [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-25 11:56:44 +02:00
Karel Zak 58bc493243 swapon: fix compiler warnings [-Wcast-qual]
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-23 11:43:47 +02:00
Karel Zak 9854912fef hwclock: fix warning
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-20 12:25:38 +02:00
Karel Zak b6cc121043 mount: add details about mtab and --namespace to mount.8
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-19 11:41:31 +02:00
Karel Zak df4f1a6647 hwclock: add --delay <seconds>
* add command line option --delay <seconds>

* read RTC type from /sys/class/rtc/rtc<N>/name

* default to 0.5 (500ms) for rtc_cmos or when RTC type is impossible
  determine; otherwise delay is 0.

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-18 13:59:15 +02:00
Karel Zak 7a287e63b9 fallocate: remove unwanted debug message
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-04 13:37:06 +02:00
Karel Zak 9c836fde5f Merge branch 'fixes' of https://github.com/rudimeier/util-linux
* 'fixes' of https://github.com/rudimeier/util-linux:
  wipefs: add missing ifdef
  lib/path: remove unused expression
  ipcs,chmem: fix access() usage
2018-07-03 13:55:32 +02:00
Karel Zak 562adaed91 fallocate: add man page note about --collapse-range granularity
Reported-by: Radka Skvarilova <rskvaril@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-07-03 13:51:51 +02:00
Ruediger Meier 77845f7bd7 ipcs,chmem: fix access() usage
Some mistakes happened lately when switching from path_exist()
to ul_path_access(). See f09a98de and 8ca31279.

This caused ipcs test failures when running i386 binaries on x86_64
hosts, because the syscall fallback was always used. That's why I
reviewed all similar changes and found another one in chmem.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2018-06-25 16:49:00 +02:00
Karel Zak bd5f7f2ef3 choom: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:49:16 +02:00
Karel Zak 4448b3ab9e blkzone: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:19:28 +02:00
Karel Zak 3736c6e444 fstrim: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:19:28 +02:00
Karel Zak fda0e2cf04 fstrim: add --dry-run
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:19:07 +02:00
Karel Zak c69bd2cbff fstrim: use new ul_path_* API, improve sysfs context usage
* improve has_discard() function to initialize sysfs context only once
* use new ul_path_* API

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:07:46 +02:00
Karel Zak 6e509042b8 lscpu: use new ul_path_* API
* use ul_path_* API for /sys/devices/system/cpu paths
* use ul_path_* API for /proc
* rename is_compatible() to is_devtree_compatible() as it works
  with the devices tree only

Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:07:46 +02:00
Karel Zak f09a98de65 ipcs: use new ul_path_* API
Signed-off-by: Karel Zak <kzak@redhat.com>
2018-06-21 13:07:46 +02:00