Commit Graph

2139 Commits

Author SHA1 Message Date
Dylan Swiggett
b52a267404 Fixes small bug in struct proc_t documentation.
From http://man7.org/linux/man-pages/man5/proc.5.html:

(22) starttime  %llu
                        The time the process started after system boot.  In
                        kernels before Linux 2.6, this value was expressed
                        in jiffies.  Since Linux 2.6, the value is expressed
                        in clock ticks (divide by sysconf(_SC_CLK_TCK)).
2020-05-11 17:39:47 +10:00
Craig Small
4090fa711b build-sys: Enable testing of sigqueue
The referenced commits enavled both pkill and kill to send an integer to
the killed or signalled process. The test_process now will report on the
integer if sent and the testsuite changes take advantage of this
new feature.

Another process make/destroy set had to be made as using spawn
instead of exec changes both the SID and TTY for the underlying
process, making other tests fail.

References:
 commit 7d55409b82
 commit 2b804a532a
2020-04-28 19:47:39 +10:00
Arun Chandrasekaran
7d55409b82 pgrep: use sigqueue to pass value with the signal.
Based on the command line option, use 'sigqueue'
instead of 'kill' to pass the integer value with
the signal.

References:
 procps-ng/procps!32

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2020-04-25 13:15:06 +10:00
Craig Small
5335851452 kill: Adjust documentation for sigqueue
Added NEWS item
Changed the section for sigqueue as its 3 for me.
2020-04-24 19:29:34 +10:00
Arun Chandrasekaran
2b804a532a kill: use sigqueue to pass value with the signal.
New -q/--queue option for kill so it will send an integer to the
signalled process. See sigqueue(3) for details.

References:
 https://pubs.opengroup.org/onlinepubs/009695399/functions/sigqueue.html
 procps-ng/procps!32

Signed-off-by: Craig Small <csmall@dropbear.xyz>
2020-04-24 19:22:47 +10:00
Wieland Hoffmann
1f5e037d4f INSTALL.md: Replace blockquotes with code blocks
The previous syntax (`> `) is for blockquotes, which don't keep newlines when
rendered. Codeblocks (` ` at the beginning of the line) do.
2020-04-24 07:50:57 +00:00
Craig Small
91a396d76e free: Adjust space to really use 9 chars
@steffhip found that while the translation hint said use 9 characters in
the free headers, it really was only 7.

Currently each line is constructed with the following (in non wide format):
Header + 6 Columns.  The header takes 7 characters and each column is 11
characters wide and prefixed with one space. Thus we have
7 + (1 + 11) * 6 = 79 characters for each line

By dropping the leading space for the first column after the header -the
header is already terminated by a colon- one could indeed provide the needed
9 letters for the header and thus have 9 + 11 * 1 + (1 + 11) * 5 = 80 Chars
per line which would fit into one line.
2020-04-24 17:42:58 +10:00
Craig Small
6442a631ac Merge branch 'utoddl/procps-master'
References:
 procps-ng/procps!78
2020-04-24 17:29:08 +10:00
Todd Lewis
c833a62418 Fix user and group name to number conversion for uid/gid above 2^31. 2020-04-24 17:28:42 +10:00
Jim Warner
fd7c66dd7b top: updated man page and copyright dates to year 2020
Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-20 22:05:34 +10:00
Jim Warner
8e0c33be46 library: adapted to the latest lxc conventions (again)
Well, shit! With release 4.0 on March 25th the lxc/lxd
folks have stuck it to us once again. They changed the
cgroup lxc prefix used to identify the container name.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-20 22:05:34 +10:00
Craig Small
95c1fbec86 NEWS: Add item for previous entry
Added NEWS item for pidof show worker threads patch

References:
 commit 9c3296bae9
2020-04-10 14:47:32 +10:00
Craig Small
9c3296bae9 Merge branch 'jrybar/procps-pidof-show-worker-pids'
References:
 procps-ng/procps!101
2020-04-10 14:45:28 +10:00
Jan Rybar
2d32ee17c9 pidof: show worker threads
Reimplementation of pidof for procps toolset contains sort of deactivated code and does not return results for processes without task.cmdline entry (usually kernel worker threads). Old pidof and pgrep do that in comparison. Despite all perks provided by using pgrep instead, pidof should show those workers again.
2020-04-10 04:42:56 +00:00
Jim Warner
9275b381d7 NEWS: fix top alpha order, add 'e' command line switch
Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-10 14:35:17 +10:00
Jim Warner
f7dc5b1728 top: for symmetry with 'E' add 'e' command line switch
Several years after the 'e' & 'E' interactive commands
were introduce to affect memory scaling, an 'E' switch
was added. This was after discovering a dropped Redhat
patch which provided a unique 'M' command line switch.

If only for symmetry it makes sense to offer a similar
command switch ('e') for the Task Area memory scaling.

As was true with 'E', top's help text will show 'e' as
if it were a switch without arguments in order to keep
help text displayed without wrap in an 80x24 terminal.
The man page, however, will show all of the arguments.

Reference(s):
https://gitlab.com/procps-ng/procps/-/issues/165
. 03/2017, added 'E' command line switch
commit fb48b5d9fb
. 12/2012, added 'e' interactive command
commit 21e550bc08
. 12/2012, added 'E' interactive command
commit bc46f67f9a

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-10 14:35:17 +10:00
Jim Warner
d93609225c ps: eliminated inadvertent trailing double semi-colons
Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-10 14:35:17 +10:00
Jim Warner
2d94282224 top: eliminate inadvertent trailing double semi-colons
Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-04-10 14:35:17 +10:00
Craig Small
4c23fcfd3c docs: Mention stime in ps.1
References:
 procps-ng/procps#164
2020-04-07 19:35:27 +10:00
Craig Small
0afe595a44 NEWS: Fix location of sysctl update
The previous commit put the sysctl directory order entries in
the wrong place.
2020-02-27 22:03:12 +11:00
Craig Small
24a1574f0a sysctl: config directory order
Matches the systemd directory order (/run is after /etc) and
document what directories are used better.
2020-02-27 21:58:07 +11:00
Jim Warner
5cd29e5093 top: restore configuration file backward compatibility
The Debian bug referenced below has nothing to do with
locales. In fact, top was made locale independent back
in release 3.3.13 (April, 2018). However, that bug did
reveal some misplaced logic which this patch corrects.

Prompted by the Qualys audit, all rcfile field strings
were checked for potential duplicates which could only
have resulted from some user's manual/malicious edits.

Unfortunately, that code was executed before top had a
chance to enforce the proper/maximum string length (in
the event an extremely old rcfile had just been read).
This created some potential string overrun references.

In top's original 3.3.15 implementation, the potential
overrun extended for 15 characters. That is the number
of field characters added with 3.3.9 (December, 2013).
But, since strchr() was used, no error exit was taken.

In the revised 3.3.16 implementation, the strchr() was
replaced with '&w->rc.fieldscur[n]'. This held overrun
to a single position while producing an error message.

So, this commit just moves that logic to a point where
fieldscur is guaranteed to be longer than EU_MAXPFLGS.

Reference(s):
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951335
. revised 3.3.16 validation logic
commit 291d98ee50
. original 3.3.15 validation logic
commit fdb58974e2

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-02-18 11:20:58 +11:00
Jim Warner
ed34b1228e top: restore one line of code to sig_endpgm() function
When that potential abend at program end was addressed
in the patch shown below, one line of code was removed
in error. That line served to suppress some end-of-job
reports should ATEOJ_RPTSTD or ATEOJ_RPTHSH be active.

So, this patch restores that previously deleted logic.

Reference(s):
. potential SEGV fix, master branch
commit d37f85c269

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-02-18 11:20:58 +11:00
Craig Small
6164fbb829 NEWS: Add missing pgrep note 2020-02-06 22:09:56 +11:00
Jim Warner
7db65421d0 ps: for abnormal end allow core dumps (fix qualys bug)
A Qualys audit patch, represented in the commit below,
added the _exit() call to our abnormal signal handler.
Unfortunately, that disabled the associated core dump.

This patch restores expected behavior of those signals
whose default produces a core dump file + termination.

Reference(s):
commit 2e4a594221

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-01-06 09:13:29 +11:00
Jim Warner
9e4c2cca39 top: at abnormal end allow core dumps (fix qualys bug)
A Qualys audit patch, represented in the commit below,
added the _exit() call to our abnormal signal handler.
Unfortunately, that disabled the associated core dump.

This patch restores expected behavior of those signals
whose default produces a core dump file + termination.

Reference(s):
commit 0847390b83

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-01-06 09:13:29 +11:00
Jim Warner
ba5f1e5449 top: reposition some data due to a translation comment
In a translator hint, under a caution, a reference was
made to the "next three items". Unfortunately however,
there was one intervening 'item' to which that caution
did not apply. This commit just relocates that 'item'.

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-01-06 09:13:29 +11:00
Jim Warner
00028aa237 top: whack insidious bug surrounding auto-sized fields
This commit duplicates a change to that newlib branch.
However, it should be noted that such a change was not
really necessary under this master branch since proc_t
data remains valid much longer. It is being duplicated
here as documentation only. Below is the original msg.

------------------------------------------------------
This patch will eliminate a bug which is unique to our
newlib branch. It's extremely rare and only happens if
a search ('L'/'&') is initiated during the period when
fields are currently being auto-sized (AUTOX_MODE on).

This bug surfaces as either all zero results for tasks
displayed or a segmentation fault, depending upon what
fields were activated. It is caused by the timing of a
call to the <pids> 'reset' function. When called after
a task refresh, but before do_key(), this bug appears.

So this patch just ensures that 'reset' will be called
after do_key() & before the tasks have been refreshed.
------------------------------------------------------

Signed-off-by: Jim Warner <james.warner@comcast.net>
2020-01-06 09:13:29 +11:00
Craig Small
bb96fc4295 pgrep: check sanity of SC_ARG_MAX
A kernel change means we cannot trust what sysconf(SC_ARG_MAX)
returns. We clamp it so its more than 4096 and less than 128*1024
which is what findutils does.

References:
 procps-ng/procps#152
 https://git.savannah.gnu.org/cgit/findutils.git/tree/lib/buildcmd.c#n535
 https://lwn.net/Articles/727862/
2020-01-05 15:05:55 +11:00
Craig Small
59c88e18f2 v3.3.16 release 2019-12-08 15:06:03 +11:00
Craig Small
d063bfc59e library: Adjust version for release
Previous release incremented the age instead of incrementing the
revision. The age can only increment if revision (internal changes
only) or current (API changes) also increments.

A C:R:A of 8.0.2 means its the latest revision of 8.0 library and
any binary linked against 8.0 will work. This is our third revision
of the 8.0 library.

References:
 https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
2019-12-08 14:56:53 +11:00
Craig Small
216477e247 nls: sync translations with make diatcheck 2019-12-08 14:44:07 +11:00
Craig Small
0e9e30e6ae build-sys: update man translation makefile
This is based upon the Makefile.am for psmisc
2019-11-28 21:53:43 +11:00
Craig Small
bfada70a8a docs: more Makefile updates
The install target was using the wrong directory and would throw
some errors where a language couldn't translate man pages. This
one should be hopefully more robust.
2019-11-12 21:15:33 +11:00
Craig Small
7bea203ab0 docs: Update translations
Downloaded the updated translations of the binaries and the manpages
from translation project. Then fixed the typos that caused po4a to
fail, mainly errant spaces.
2019-11-11 21:52:21 +11:00
Craig Small
2590e3be42 build-sys: Use po4a for manpage translations
Using the newer po4a tool for manpage translations. Also removing
the manpage po file update from dist target because it should be
something the is explicitly done.

The git repository will hold the original man pages and the
po translation files. The distribution tarball will hold those
and the translated manpages. This means most people won't need po4a
as the distribution fill will have these translated manpages.
2019-11-11 21:41:00 +11:00
Craig Small
e79095ddcc build-sys: Install translated manpages
References:
 procps-ng/procps#146
2019-10-31 20:48:15 +11:00
Craig Small
d9a485e39e docs: skill.1 - Remove trailing ^Z
skill.1 man page had trailing ^Z which cause the translation
engine all sorts of problems.
2019-10-31 14:24:17 +11:00
Craig Small
bf26c683d8 nls: minor reference updates 2019-10-29 07:59:15 +11:00
Craig Small
d5e3650fc3 nls: Add all man pages to pot file
The previous Makefile rule would only put the first required file
into the pot file because it used $< Unfortunately, due to how
po4a tools work, its not just a simple matter of changing it to $^
and you're done, but needs a foreach loop to add -m to each manpage
file.

This is a temporary fix, after some more work looking into po4a the
unified tool (called po4a) will be used.
2019-10-29 07:48:50 +11:00
Jim Warner
fead750c67 top: update copyright notations & fix a man page error
Beyond the copyrights, the single oops in the man page
was introduced in the commit which is referenced below
dealing with some cleanup following that Qualys audit.

Reference(s):
. man page error introduced
commit e531c78140

Signed-off-by: Jim Warner <james.warner@comcast.net>
2019-10-27 22:17:27 +11:00
Craig Small
a2b7106793 snice: Fix matching on PID
@MarsChan correctly pointed out that the read() always returns 128
bytes, so skipping on >= 128 will always mean we skip. Their suggestion
was to remove the equality, but read will never go past 128 bytes so
I just removed that part of the check.

References:
 procps-ng/procps!89
2019-10-22 08:14:35 +11:00
Craig Small
52364d548a Merge branch 'ylecuyer/procps-patch-1'
References:
  procps-ng/procps!86
2019-09-21 17:08:53 +10:00
Yoann Lecuyer
41805d8d89 top: fix out-of-band read when using -p with exactly 20 pids 2019-09-21 17:07:41 +10:00
Craig Small
8145700899 Merge branch 'cbaenziger/procps-pgrep_more_than_4k'
References:
 procps-ng/procps!85
2019-09-21 16:43:50 +10:00
Clay Baenziger
f5fbbdbef8 testsuite: pgrep: Provide test for matching a more than 4k command line; beware as TCL does not seem to match on strings >4k 2019-09-21 16:39:13 +10:00
Clay Baenziger
f9e56d3c66 pgrep: Use POSIX _SC_ARG_MAX for maximum full command line length 2019-09-21 16:39:13 +10:00
Craig Small
c660dbae1b pidof: Fix separator option
Short separator option used 's' instead of 'S' which
meant it pidof would use the single-shot option when you
meant separator.

Added alias for -S using -d to give some sysvinit pidof
compatibility.

References:
    commit 73492b182d
    procps-ng/procps#141
2019-09-21 16:17:05 +10:00
Craig Small
bdce977a4e watch: fix unsetting of COLOR flag
watch used to check if COLOR was required, check if color was
possible then.. set the flag again.

It should have been cleared after failing to get colors out of
ncurses.

References:
 procps-ng/procps#143
2019-09-21 16:03:28 +10:00
Craig Small
7af88da373 sysctl: ignore errors from lines starting with -
The systemd sysctl ignores errors from preload files that start
with a hyphen.  This change brings the procps sysctl into line with
their change.

References:
    procps-ng/procps#138
    https://github.com/systemd/systemd/pull/13191
    https://github.com/systemd/systemd/pull/13141
2019-09-21 15:50:53 +10:00