Commit Graph

10948 Commits

Author SHA1 Message Date
Jim Patterson 01544c52f8 wall: add --group option
The wall command on AIX supports a "-g" option to limit the message
to a group of users by gid.  Add compatibility to the Linux version.

Thanks to Sami Kerola <kerolasa@iki.fi> for an initial skeleton
implementation.

[kzak@redhat.com: - rename max to ngroups
                  - add free_group_workspace()
                  - some cosmetic changes]

Reference: http://www.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.cmds6/wall.htm
Signed-off-by: Jim Patterson <jimp@wegrok.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-12-02 13:53:03 +01:00
OGAWA Hirofumi 3fcbd79789 lsns: Fix parser for /proc/<pid>/stat which is including space in comm
For example, child process of spamd has

    32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...

fscanf("%d %*s %c %d*[^\n]") in read_process() can't parse above as we
expected, because %s only skips non-whitespace. I.e. it parses like
following,

    32031 (spamd child) S 32026 32026 32026 0 -1 4210752 338 0 0 0 ...
    +---+ +----+ +
      %d    %*s  %c

and returns 2 (pid=32031, state=c).

This fixes it by skipping task->comm part manually.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
2016-12-02 13:20:41 +01:00
Ruediger Meier 12f17a23df misc: fix typos using codespell
# command used was:
 $ ~/src/codespell/codespell \
   -w -D /home/rudi/src/codespell/build/lib/codespell_lib/data/dictionary.txt \
   $(git ls-files | grep -v "^po/\|\.xz$\|\.gz$\|\.bz2$\|\.img$\|^Documentation/releases/")

 BTW some manually grammer fixes:
   s/uses/used/
   s/begin/beginning/

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-12-01 00:01:43 +01:00
Ruediger Meier 223939d95b misc: spelling, always use "cannot" instead of "can not"
Just to be consistent ...

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-30 14:56:50 +01:00
Karel Zak a99c0eb09f tests: update sfdisk output
The output of the "New situation:" contains

 Disklabel type: <name>
 Disk identifier: <removed>

lines now.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 13:07:11 +01:00
Karel Zak 35ca511827 sfdisk: support empty label use-case
By default sfdisk creates partition table when a first partition is
specified, otherwise the device is not modified. This force users to
create at least one partition.

This commit allows to create empty label without partitions if "label:
<name>" header line is specified by script.

The commit also modifies "New situation:" output to list label name
and label identifier.

Addresses: https://github.com/karelzak/util-linux/issues/374
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 13:01:33 +01:00
Karel Zak c49b765a6e sfdisk: cleanup --dump error messages
old:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: failed to dump partition table: Success

new:
  # truncate -s 1G empty && ./sfdisk --dump empty
  sfdisk: empty: does not contain a recognized partition table.

Addresses: https://github.com/karelzak/util-linux/issues/375
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 10:57:39 +01:00
Karel Zak 96ccf9478d tests: update lsmem tests
The commit 4c0e1eaf34 modifies the
alignment of the STATE column.

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-30 10:47:41 +01:00
Karel Zak 1c4284c19b Merge branch 'master' of https://github.com/rudimeier/util-linux 2016-11-29 17:08:23 +01:00
Karel Zak fed304837f sfdisk: don't be silent when list non-existing device
Addresses: https://github.com/karelzak/util-linux/issues/376
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29 16:01:46 +01:00
Karel Zak e1a0fd98cd build-sys: use sed to substitute
Travis CI:
tools/git-version-gen: 116: tools/git-version-gen: Bad substitution

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-29 14:25:23 +01:00
Ruediger Meier a341a5e2e4 build-sys: cosmetics, avoid useless m4 quotes
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 12:42:11 +01:00
Ruediger Meier 3f5dfa2978 build-sys: fix bashism, introduced in 85004b14
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 12:41:53 +01:00
Ruediger Meier 85004b142a build-sys: fix "remove the g in git describe"
The "g" was not always removed and "-rc*" follow-ups were handled
incorrectly.

So now after last commits we have these versions:

 git describe            -> blkid -V
 --------------------------------------------------------------
 v2.29-rc4               -> 2.29-rc4          (libblkid 2.29.0)
 v2.29-rc4-3-g4c8928d    -> 2.29-rc4-3-4c89   (libblkid 2.29.0)

 v2.29                   -> 2.29              (libblkid 2.29.0)
 v2.29-78-g4c8928d       -> 2.29.78-4c89      (libblkid 2.29.78)

 v2.29.1                 -> 2.29.1            (libblkid 2.29.1)
 v2.29.1-4-g4c8928d      -> 2.29.1.4-4c89     (libblkid 2.29.1)

 v2.29.1-rc2             -> 2.29.1-rc2        (libblkid 2.29.1)
 v2.29.1-rc2-3-g4c8928d  -> 2.29.1-rc2-3-4c89 (libblkid 2.29.1)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Ruediger Meier 6ac59b5bd5 build-sys: remove old git fallback from git-version-gen
Just make the script more readable. Nobody is using 10 years old
git.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Ruediger Meier 0f0972ac6b build-sys: cosmetics PACKAGE_VERSION_MINOR
This should changes nothing.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Ruediger Meier b5511797f2 build-sys: update package release number during development
Now we use
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.5)
instead of
   v2.29-5-g8ffab30  -> 2.29.5-8ffa   (libblkid 2.29.0)

otherwise the bugfix releases (2.29.1) would look newer that latest HEAD.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Ruediger Meier c42a6d4d34 build-sys: fix empty package release number
Was broken for major releases since b0e6b25e:
  $ blkid -V
  blkid from util-linux 2.28  (libblkid 2.28., 12-Apr-2016)

Now we also set 0 in this case, like:
  $ blkid -V
  blkid from util-linux 2.30  (libblkid 2.30.0, 12-Apr-2016)

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
2016-11-29 10:47:11 +01:00
Michael Kerrisk (man-pages) 170a8e4ad5 IPC namespaces also isolate POSIX message queues
As described in pid_namespaces(7), IPC namespaces also
isolate POSIX message queues. Update the unshare(1)
and nsenter(1) pages to clarify that.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) 894efece9e Provide better cross references for namespace concepts
For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f85b9777c2 Provide better cross references for namespace concepts
For each namespace that is discussed, add more explicit
references to the corresponding clone(2) flags and
add references to relevant section 7 namespace pages.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) 4a3f07352b SEE ALSO: add cross reference to namespaces(7)
Rationale: both of these pages are about namespaces.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f76c7478a0 Replace reference to sigvec(2) with sigaction(2)
The sigvec(3) (not sigvec(2)) page documents ancient BSD APIs.
The right page to cross reference here is sigaction(2),
which documents the modern POSIX APIs.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) b2cc2a7fc6 Fix formatting errors in page cross references
These pages had errors such as

    .BR page (x) .

which should be

    .BR page (x).

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) 154aede1fb Fix reference for scheduling discussion
Some time back, I moved the discussion of scheduling from
sched_setscheduler(2) to a new sched(7) page. Adjust the cross
reference in the taskset(1) page accordingly.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f00218ffb8 Fix section number in lockf() page xref
lockf() is in section 3, not 2.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) a7bbc2f36c Fix page cross references
* Add a section number to page cross reference
* Format cross references in bold

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) 42632a90c1 Correctly format page cross references
Most pages in util-linux follow the standard convention
of formatting page cross references in bold. Fix the
few exceptions that use italic.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) f053ff1e3a Place SEE ALSO entries in order
This patch does only the following:

* Order SEE ALSO entries first by section name, then alphabetically
  within section
* Adds one or two missing commas in SEE ALSO lists
* Removes one or two periods that were (inconsistently) used
  at the end of SEE ALSO lists.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Michael Kerrisk (man-pages) 4a2ec98bf1 Fix typo in page cross reference (capabilities(7), not, capability(7))
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2016-11-29 10:44:19 +01:00
Heiko Carstens 51a90159dd lsmem: improve node lookup
Break the loop as soon as we found the node a memory block belongs to,
it doesn't make sense to continue scanning.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Karel Zak 1b0af4ba17 lsmem: (man page) recommend use --output
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 4c0e1eaf34 lsmem: align STATE to the right
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak a5c4535b0d lsmem: add Copyright
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 6ca268eca7 tests: add x86_64-16g lsmem test
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 2b68dc7d0d tests: cleanup and update lsmem
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 3845c7302d lsmem: add missing placeholders
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak d4625442c7 lsmem: cleanup for --summary=only
* don't fill scols table
* check for collision with raw,pairs and json options

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 4775cc69a7 lsmem: cleanup man page
* add missing new options
* remove columns description (for ls-like utils we maintains columns
  description only in the --help output)

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 019ad6c1c2 lsmem: disable summary for JSONm, raw and export output
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak c5332fbbcd lsmem: add --summary[=<when>] option
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 0cf0710aed lsmem: rename control struct
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak 0a1ed6dffb lsmem: cleanup, use libsmartcols for all output
* add --pairs, --raw a --json outputs
* add --noheadings to disable header
* add --bytes
* add --output <list>

Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Karel Zak bdfe4601c3 build-sys: mark lsmem and chmem as Linux only
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-09 10:02:32 +01:00
Heiko Carstens 2ae9a58e0d lsmem: add testcase
Add a single s390 specific test case to verify that the contents of
various output formats do not change in incompatible way if the
lsmem code is changed.

This is based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Heiko Carstens 30e1ea8ba1 chmem: new tool
Move the s390 specific chmem tool to util-linux.

The chmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html

Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.

This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.

The chmem tool can be used to set memory online or offline. This can
be achieved by specifying a memory range:

Memory Block 19 (0x0000000130000000-0x000000013fffffff) disabled

or by specifying a size where chmem will automatically select memory
blocks:

Memory Block 21 (0x0000000150000000-0x000000015fffffff) disable failed
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled

or by specifying memory block numbers instead of address ranges:

Memory Block 15 (0x00000000f0000000-0x00000000ffffffff) disabled
Memory Block 16 (0x0000000100000000-0x000000010fffffff) disabled
Memory Block 17 (0x0000000110000000-0x000000011fffffff) disabled
Memory Block 18 (0x0000000120000000-0x000000012fffffff) disabled

This is based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Heiko Carstens cad2d1ac92 lsmem: new tool
Move the s390 specific lsmem tool to util-linux.

The lsmem tool was originally written in perl and is part of the
s390-tools package which can be found here:
https://www.ibm.com/developerworks/linux/linux390/s390-tools.html

Given that the tool is architecture independent, there is no reason to
keep it in an s390 specific repository. It seems to be useful for
other architectures as well.

This patch converts the tool to C and adds it to util-linux, while the
command line options stay compatible. The only exception is the option
"-v" which used to be the short form of "--version". That got changed
to "-V" so it behaves like most other tools contained within
util-linux.

The lsmem tool inspect the contents of /sys/devices/system/memory and
prints a summary output similar to what lscpu does:

RANGE                                 SIZE STATE   REMOVABLE BLOCK
0x0000000000000000-0x000000005fffffff 1,5G online  yes       0-5
0x0000000060000000-0x000000007fffffff 512M online  no        6-7
0x0000000080000000-0x000000013fffffff   3G online  yes       8-19
0x0000000140000000-0x000000014fffffff 256M offline -         20
0x0000000150000000-0x000000017fffffff 768M online  no        21-23

Memory block size   :     256M
Total online memory :     5,8G
Total offline memory:     256M

In order to keep the output small the tool merges subsequent address
ranges where the attributes are identical. To avoid merging of line
the "-a" option can be used.

The lsmem tool also has "--extendend" and "--parsable" option which
can be used to customize the output, e.g.  limit the output to
specified columns. This is quite similar to what the lscpu tool does.

This is based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Heiko Carstens 54394eab03 lib,strutils: add strtoux[16|32|64]_or_err functions
Add helper functions which allow to parse hexadecimal numbers.
Based on a patch from Clemens von Mann.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2016-11-09 10:02:32 +01:00
Karel Zak 5bd2b14de4 build-sys: release++ (v2.29)
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-08 11:35:40 +01:00
Karel Zak 8ebed16914 docs: update v2.29-ReleaseNotes
Signed-off-by: Karel Zak <kzak@redhat.com>
2016-11-08 11:34:10 +01:00